This is the code I wrote:
MailMessage mail = new MailMessage("[email protected]", "[email protected]");
mail.Subject = "This is a test!!";
mail.Body = "testing...";
SmtpPermission connectAccess = new SmtpPermission(SmtpAccess.Connect);
System.Console.WriteLine("Access? " + connectAccess.Access);
SmtpClient client = new SmtpClient("mail.myurl.com", 2525);
client.Send(mail);
It's not working. I get an exception at the line "client.Send(mail)" that says "Mailbox unavailable. The server response was (MYLOCALCOMPUTERNAME) [MY LOCAL IP]:3045 is currently not permitted to relay through."
connectAccess.Access does return "Connect" (I'm not sure if this was necessary... I added it in to start the troubleshooting process.)
Does this mean that my local machine has to be configured in some way? What about when I deploy my app to other peoples machines? Will there need to be local configuration there? I'm just looking to create a "Send Feedback" type of link from my application.
(Note: in my real application I am using my real email addresses in both the "to" and "from" and my smtp is really my smtp address at the place that hosts my url/website)
thanks!
-Adeena