How can I send an e-mail by PasswordRecovery class

Discussion in 'ASP .Net' started by =?Utf-8?B?SHVzYW0=?=, Jun 11, 2007.

  1. 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 ="">
    <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("", "", "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
     
    =?Utf-8?B?SHVzYW0=?=, Jun 11, 2007
    #1
    1. Advertising

  2. =?Utf-8?B?SHVzYW0=?=

    Mike Guest

    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" <> wrote in message
    news:...
    > 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 ="">
    > <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("", "",
    > "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
     
    Mike, Jun 11, 2007
    #2
    1. Advertising

  3. 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/library/ms178335(vs.80).aspx

    http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.passwordrecovery.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" <> wrote in message
    news:...
    > 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 ="">
    > <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("", "", "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
     
    Juan T. Llibre, Jun 11, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arjen
    Replies:
    0
    Views:
    593
    Arjen
    Jun 6, 2005
  2. Nathan Sokalski
    Replies:
    3
    Views:
    1,986
    Larry Lard
    Nov 23, 2005
  3. =?Utf-8?B?UmFq?=

    PasswordRecovery - Sending Mail

    =?Utf-8?B?UmFq?=, Mar 28, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    370
    =?Utf-8?B?UmFq?=
    Mar 28, 2007
  4. Greg

    Trying to cancel e-mail for PasswordRecovery control

    Greg, Oct 8, 2009, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    642
  5. malhenry
    Replies:
    0
    Views:
    245
    malhenry
    Feb 28, 2007
Loading...

Share This Page