Failed to send SMTP mail with .NET, network problem?
I am trying to send an smtp email via gmail smtp server using the following code:
MailMessage message = new MailMessage("myEmail@gmail.com", "myEmail@purdue.edu", "Testing SMTP", "Test, yo");
SmtpClient client = new SmtpClient();
client.EnableSsl = true;
client.Host = "smtp.gmail.com";
client.Port = 587;
client.Credentials = new NetworkCredential("myEmail@gmail.com", "myPassword");
client.Send(message);
Using the same code, my friend successfully sent me an email from another network, but .NET is throwing an error message "No connection could be made because the target machine has actively refused it. 74.125.91.109:587". Should this be a network problem?
My network administrator claims there are no outgoing ports blocked and my firewall is completely disabled, what else could be causing this? I also tried Purdue smtp server (smtp.purdue.edu) and it fails with the same message.
a source to share
This could be because McAfee Virus is blocking bulk mailing worms. you can do the following:
1. Open the VirusScan Console by right-clicking the VirusScan screen in the taskbar and select VirusScan Console ...
2. Double-click Access Protection and open it.
3. Make sure the "Send mail worms" rule is from the send mail rule.
4.Click OK and close VirusScan Console.
Hope this is helpless.
a source to share