The following code nets me out error after error.
MailMessage Enveloppe = new MailMessage();
//emails is an array of strings
foreach ( string email in emails )
Enveloppe.To.Add(email);
//Setup message parameters
Enveloppe.Subject = "Documentation";
Enveloppe.Body = "Infinitelycoolbodyhere"
Enveloppe.From = new MailAddress("mrzombie@stuff", "Myname");
//files is an array of strings
foreach ( string filename in files ) {
//Add attachments
Enveloppe.Attachments.Add(new Attachment(new System.Net.WebClient().OpenRead(filename),filename.Substring(filename.LastIndexOf('/'))));
}
//Create the smtp client, and let it do its job
SmtpClient Mailman = new SmtpClient("mysmtphost");
Mailman.EnableSsl = true;
Mailman.Port = 465;
Mailman.DeliveryMethod = SmtpDeliveryMethod.Network;
Mailman.Credentials = new System.Net.NetworkCredential("usernamehere", "passwordhere");
Mailman.Send(Enveloppe);
It so happens that it either tells me that my operation timed out, or that "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond".
I'm stumped, I don't see which part of it I am doing wrong
Update: I can't seem to connect to the server from Telnet, at best I connect with my laptop (under ubuntu), but I never get the "200" response. Under the windows workstation, I get a perpetual blank telnet window.
I can send/receive e-mail at the specified server with Thunderbird without any problem whatsoever.