From your reply:"You're mixing up variable names and type names.
This is not correct:
Dim SmtpClient As mySmtpClient = New SmtpClient()
The syntax is: Dim variableName As TypeName = New TypeName() "
Well,thank a lot for your assistant regarding my previous question.
I did retype and chang my code to your suggestion.And as a result, I received this error message.
Code:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'mySmtpClient' is not defined.
Source Error:
Line 6:
Line 7:
Line 8: Dim SmtpClient As mySmtpClient = New mySmtpClient()
Line 9: mySmtpClient.EnableSsl = True
Line 10: mySmtpClient.Send(e.Message)
I'm using
VB language.
This is my code in SendingMail event:
Code:
Partial Class SignUp
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 SmtpClient As mySmtpClient = New mySmtpClient()
mySmtpClient.EnableSsl = True
mySmtpClient.Send(e.Message)
e.Cancel = True
End Sub
End Class
And this is my coding in web.config:
Code:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="[email protected]">
<network
port="587"
userName="[email protected]"
password="mypassword"
host="smtp.live.com"
/>
</smtp>
</mailSettings>
</system.net>
Now, I really don't know what to do....only SignUp.aspx page cannot send the email confirmation.
For ContactUs.aspx is running smoothly.
Anyway,...thank you so much for helping.
