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
[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);[/CODE]
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
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.
It is because some servers got their subnets listed in spam block lists, we are still working on this but have no abuse complaints about them, very frustrating to get blocked with no abuse complaints!
This was resolved around 10:22 ps PST last night. That is when I received all the test emails I had sent earlier in the day as well as all the orders that had been submitted.
However, it seems to have returned again this morning. I just sent some tests through and received nothign again.
We have a subnet that is shared with someone else at our colo cage, and they we are on a seperate subnet, but the same master ARIN subnet, we are trying urgently to find if this is their fault, or ours, but we have no abuse complaints saying it is us.
I have gotten replies from the RBL operators, and we are working out the issue, the IPs have been delisted/are being delisted now, and should not come back up, it was a bit of a policy change that caused this and had adverse side-effects.