Hi,
I am using the ASP.NET membership provider controls (ChangePassword and PasswordRecovery) and they generally work just fine.
Unfortunately they don't send any emails once the process is finished.
I set up the SMTP server using the ASP.NET Configuration Website and it added the following lines to the web.config:
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network host="pagetailors.de" password="XXXX" userName="XXXX" />
</smtp>
</mailSettings>
</system.net>
I also tried using the IP adress of the server instead of the domain.
In addition to that I set the maildefinition properties on the used web controls:
<MailDefinition From="[email protected]"
Subject="Your new password">
</MailDefinition>
Once I finish changing or resetting the password, the controls shows the success message. It does not show any errors but the mails are not sent.
I also checked the SMTP log files on the server (it's a MailEnable server) but couldn't even find an attempt to send these messages.
I am using a custom email helper class which manually sends an email using the following settings:
public static void SendEmail(string from, string to, string subject, string body)
{
SmtpClient mailClient = new SmtpClient(ConfigReader.GetStringValue("MailServer"));
mailClient.Credentials = new NetworkCredential(ConfigReader.GetStringValue("MailUsername"),
ConfigReader.GetStringValue("MailPassword"));
MailMessage mailMessage = new MailMessage(from, to, subject, body);
mailClient.Send(mailMessage);
}
The values for mailserver, username and password read from the config file are the same as defined in the ASP.NET configuration tool. These mails are delivered successfully.
Any ideas? Thanks in advance!