Click here to Skip to main content
16,007,443 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: ASP.NET Authorisation Problem in Vista Pin
Todd Smith7-Feb-08 11:14
Todd Smith7-Feb-08 11:14 
GeneralRe: ASP.NET Authorisation Problem in Vista Pin
Gandalf_TheWhite7-Feb-08 18:39
professionalGandalf_TheWhite7-Feb-08 18:39 
QuestionAsp .net web directory Pin
Radu_207-Feb-08 5:32
Radu_207-Feb-08 5:32 
QuestionTreeView help [modified] Pin
kingletas7-Feb-08 5:07
kingletas7-Feb-08 5:07 
GeneralRe: TreeView help Pin
Christian Graus7-Feb-08 9:08
protectorChristian Graus7-Feb-08 9:08 
Questionhttps request [modified] Pin
abu sundus7-Feb-08 4:24
abu sundus7-Feb-08 4:24 
GeneralRe: https request Pin
Sam Xavier13-Mar-08 22:57
Sam Xavier13-Mar-08 22:57 
Questionset SmtpPermission on SmtpClient user control object on an .aspx page Pin
GDMFSOB7-Feb-08 4:02
GDMFSOB7-Feb-08 4:02 
Can Someone help here, I am getting the following error on a Windows forms User Control running on an asp.net webpage,

"request for permission of type system.net.mail.smtppermission failed",

the User Control is a complied DLL and I have included it on the ASp.net page, the user control is supposed to send an email when I click send it works fine in a vb form and does run the code on the webpage but wont send the email. how do i set the SMtp Permission in my code using the SmtpPermission Class in System.Net.Mail.

below is the code for sending the mail in the dll,

Function SendMail(ByVal MailServer As String, ByVal mailUser As String, ByVal MailPassword As String, ByVal EmailAddress As String, ByVal Message As String, ByVal FormAddress As String, ByVal Subject As String, ByVal Port As String, ByVal Auth As Boolean) As Boolean
Try

Dim message1 As New MailMessage(EmailAddress, FormAddress, Subject, HttpUtility.HtmlDecode(Message).ToString)
message1.IsBodyHtml = True
Dim emailClient As New SmtpClient(MailServer)
emailClient.UseDefaultCredentials = False
' used to authenticate the account used for sending mail
If Auth = True Then
Dim basicAuthenticationInfo As New System.Net.NetworkCredential(mailUser, MailPassword)
emailClient.Credentials = basicAuthenticationInfo
End If
emailClient.Port = CInt(Port)
emailClient.Send(message1)
Return True
Catch ex As Exception
MsgBox("SendMail Failed: " & ex.Message)
Return False
End Try
End Function

I have included the dll like so on the aspx webpage

<OBJECT id="SendMail2" height="193" width="527" classid="http:OCTBulkMailer.dll#OCTBulkMailer.eMailer" VIEWASTEXT >
<PARAM NAME="fromAddressVal" VALUE="email">
<PARAM NAME="emailEmailSubjectVal" VALUE="Testmail from OCT Mailer">
<PARAM NAME="emailMessageVal" VALUE='<%= Message %>' >
<PARAM NAME="SmtpAuthVal" VALUE="True">
<PARAM NAME="SmtpPassVal" VALUE="pass">
<PARAM NAME="SmtpUserVal" VALUE="email">
<PARAM NAME="Title" VALUE="Bulk Mailer">
<PARAM NAME="EmailAddressesVal" VALUE='<%= addresses %>'>
<PARAM NAME="SmtpServerVal" VALUE="server">
<PARAM NAME="SmtpPortVal" VALUE="25">
<PARAM NAME="Instructions" VALUE="Click Start to Start sending your mails">
</OBJECT>
Generalwhy the function should be in public while creating a dll Pin
jagan1237-Feb-08 3:16
jagan1237-Feb-08 3:16 
GeneralRe: why the function should be in public while creating a dll Pin
Sandeep Akhare7-Feb-08 3:25
Sandeep Akhare7-Feb-08 3:25 
GeneralRe: why the function should be in public while creating a dll Pin
jagan1237-Feb-08 3:27
jagan1237-Feb-08 3:27 
GeneralRe: why the function should be in public while creating a dll Pin
Sandeep Akhare7-Feb-08 3:31
Sandeep Akhare7-Feb-08 3:31 
GeneralRe: why the function should be in public while creating a dll Pin
Christian Graus7-Feb-08 9:26
protectorChristian Graus7-Feb-08 9:26 
QuestionDisplaying Images Pin
munklefish7-Feb-08 2:32
munklefish7-Feb-08 2:32 
GeneralRe: Displaying Images Pin
Sandeep Akhare7-Feb-08 2:36
Sandeep Akhare7-Feb-08 2:36 
GeneralRe: Displaying Images Pin
munklefish7-Feb-08 2:44
munklefish7-Feb-08 2:44 
GeneralRe: Displaying Images Pin
Sandeep Akhare7-Feb-08 2:51
Sandeep Akhare7-Feb-08 2:51 
GeneralRe: Displaying Images Pin
munklefish7-Feb-08 3:00
munklefish7-Feb-08 3:00 
GeneralRe: Displaying Images Pin
munklefish7-Feb-08 2:44
munklefish7-Feb-08 2:44 
GeneralRe: Displaying Images Pin
Sandeep Akhare7-Feb-08 2:48
Sandeep Akhare7-Feb-08 2:48 
GeneralRe: Displaying Images Pin
munklefish7-Feb-08 2:51
munklefish7-Feb-08 2:51 
GeneralRe: Displaying Images Pin
pmarfleet7-Feb-08 8:26
pmarfleet7-Feb-08 8:26 
GeneralRe: Displaying Images Pin
Christian Graus7-Feb-08 9:29
protectorChristian Graus7-Feb-08 9:29 
GeneralLanguage Independancy. Pin
Jeneesh K. Velayudhan7-Feb-08 2:10
Jeneesh K. Velayudhan7-Feb-08 2:10 
GeneralRe: Language Independancy. Pin
Imran Khan Pathan7-Feb-08 2:19
Imran Khan Pathan7-Feb-08 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.