Hi!
I am having probleming solving this.
I know that I can't enable ssl in web.config file but must do this in the codebehind of the control.
I have configured the web.config file with port, username, password and mailaddress. I have tried a
C# code snippet which worked with no problems, but i need it to be in vb. Can anyone tell me what is wrong? I get
no error messages, everything seems fine, but no mail is sent.
The code is:
Imports System
Imports System.Net.Mail
Imports System.Web.UI.WebControls
Partial Public Class Default2
Inherits System.Web.UI.Page
Protected Sub CreateUserWizard1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles CreateUserWizard1.SendingMail
Dim mySmtpClient As SmtpClient = New SmtpClient()
mySmtpClient.EnableSsl = True
mySmtpClient.Send(e.Message) e.Cancel = True
End Sub
End Class
I am having probleming solving this.
I know that I can't enable ssl in web.config file but must do this in the codebehind of the control.
I have configured the web.config file with port, username, password and mailaddress. I have tried a
C# code snippet which worked with no problems, but i need it to be in vb. Can anyone tell me what is wrong? I get
no error messages, everything seems fine, but no mail is sent.
The code is:
Imports System
Imports System.Net.Mail
Imports System.Web.UI.WebControls
Partial Public Class Default2
Inherits System.Web.UI.Page
Protected Sub CreateUserWizard1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles CreateUserWizard1.SendingMail
Dim mySmtpClient As SmtpClient = New SmtpClient()
mySmtpClient.EnableSsl = True
mySmtpClient.Send(e.Message) e.Cancel = True
End Sub
End Class