By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,969 Members | 1,522 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,969 IT Pros & Developers. It's quick & easy.

How can I send an e-mail by PasswordRecovery class

P: n/a
Hi EveryBody:

I use the PasswordRecovery Class to recover the user password, as we know
there is
some setting that must be done to config the mail, I but the following code
into my web config file :

<system.net>
<mailSettings>
<smtp from ="hu*******@yahoo.com">
<network host="127.0.0.1" port="25" />
</smtp>
</mailSettings>
</system.net>

also the code that I use it in to my application is as followe:

imports System.net.mail

Dim smtpserver As New SmtpClient
smtpserver.Host = "127.0.0.1"
Dim MyMail As MailMessage = New MailMessage()
MyMail.BodyEncoding = Encoding.UTF8
MyMail.IsBodyHtml = True

MyMail.Body = "Dear User your password is: "
smtpserver.Send("hu*******@yahoo.com", "hu***********@gmail.com", "Password
Recovery", MyMail.Body)

But I still did not recive the messge.

Can Some body tell me if there is a problem in my code or any redirection
will be appreciated

regrad's

husam
Jun 11 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
do you have SMTP configured on your local web server your using?
Check the 'bad mail' folder on your server and see if you have any files in
there. If so then your email isn't being sent due most likely by not having
your SMTP server configured. Do you have an actualy SMTP server you can test
against instead of 127.0.0.1 (localhost)?

"Husam" <Hu***@discussions.microsoft.comwrote in message
news:EA**********************************@microsof t.com...
Hi EveryBody:

I use the PasswordRecovery Class to recover the user password, as we know
there is
some setting that must be done to config the mail, I but the following
code
into my web config file :

<system.net>
<mailSettings>
<smtp from ="hu*******@yahoo.com">
<network host="127.0.0.1" port="25" />
</smtp>
</mailSettings>
</system.net>

also the code that I use it in to my application is as followe:

imports System.net.mail

Dim smtpserver As New SmtpClient
smtpserver.Host = "127.0.0.1"
Dim MyMail As MailMessage = New MailMessage()
MyMail.BodyEncoding = Encoding.UTF8
MyMail.IsBodyHtml = True

MyMail.Body = "Dear User your password is: "
smtpserver.Send("hu*******@yahoo.com", "hu***********@gmail.com",
"Password
Recovery", MyMail.Body)

But I still did not recive the messge.

Can Some body tell me if there is a problem in my code or any redirection
will be appreciated

regrad's

husam

Jun 11 '07 #2

P: n/a
Re:
!How can I send an e-mail by PasswordRecovery class

Please compare your code to the sample code provided at :

http://msdn2.microsoft.com/en-us/lib...35(vs.80).aspx

http://msdn2.microsoft.com/en-us/lib...drecovery.aspx

Notice the web.config entries which you are, apparently, missing.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Husam" <Hu***@discussions.microsoft.comwrote in message
news:EA**********************************@microsof t.com...
Hi EveryBody:

I use the PasswordRecovery Class to recover the user password, as we know
there is
some setting that must be done to config the mail, I but the following code
into my web config file :

<system.net>
<mailSettings>
<smtp from ="hu*******@yahoo.com">
<network host="127.0.0.1" port="25" />
</smtp>
</mailSettings>
</system.net>

also the code that I use it in to my application is as followe:

imports System.net.mail

Dim smtpserver As New SmtpClient
smtpserver.Host = "127.0.0.1"
Dim MyMail As MailMessage = New MailMessage()
MyMail.BodyEncoding = Encoding.UTF8
MyMail.IsBodyHtml = True

MyMail.Body = "Dear User your password is: "
smtpserver.Send("hu*******@yahoo.com", "hu***********@gmail.com", "Password
Recovery", MyMail.Body)

But I still did not recive the messge.

Can Some body tell me if there is a problem in my code or any redirection
will be appreciated

regrad's

husam


Jun 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.