Ok so here is my code, I am trying to send an email upon user registration. I had to do a little research on Authenticating with ASP 2.0 but This looks like it should be working... Can anyone tell me what I am doing wrong, as I keep getting errors
I error out on the smtp.Send method. Not sure what I'm doing wrong, but thought maybe some new eyes would see something I am missing.
The Error I get is as follows
Code:
HttpContext ctx = HttpContext.Current;
StreamReader sr = new StreamReader(ctx.Server.MapPath("/library/emails/Welcome.txt"));
string strBody = sr.ReadToEnd();
sr.Dispose();
strBody = strBody.Replace("{!Alias}", _FirstName);
strBody = strBody.Replace("{!Password}", _Email);
MailAddress from = new MailAddress("[email protected]", "My Title.");
MailAddress to = new MailAddress(_Email);
MailMessage message = new MailMessage(from, to);
message.Subject = "Welcome to the site!";
message.Body = strBody;
message.IsBodyHtml = false;
message.Priority = MailPriority.Normal;
SmtpClient smtp = new SmtpClient("mail4.mysite.com");
smtp.UseDefaultCredentials = false;
smtp.Credentials = new System.Net.NetworkCredential("myUSERNAME", "myPASSWORD");
smtp.Send(message);
I error out on the smtp.Send method. Not sure what I'm doing wrong, but thought maybe some new eyes would see something I am missing.
The Error I get is as follows
Any assistance would be great!Error in processing. The server response was: http://www.spamhaus.org/query/bl?ip=64.187.108.200
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: Error in processing. The server response was: http://www.spamhaus.org/query/bl?ip=64.187.108.200