[Need Help] Sending email with c#
Well, I recently wrote a c# app sending email by connecting to known SMTP servers using System.Net.Mail, and sending mail from your account without having to connect to the site.
The problem is I can send mail only from Gmail accounts. both yahoo, hotmail and another less know host Walla(from my country), fail to send emails and pop-up different errors.
- when i try to connect to yahoo through my account i get this error:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html
- when i try to connect to walla through my account there i get this error:
Mailbox unavailable. The server response was: 5.7.1 <email@example.com>... Relaying denied. Please check your mail first or restart your mail session.
I tried to set the next property:
_client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
_client.PickupDirectoryLocation = @"c:\temp";
(_client is my SmtpClient)
and tried to set the default Pickup directory to different paths manually. after setting it up, the program acts as if it has sent the massage successfully but it never gets to the 'SendCompleted' event and the email never gets to it's destination.
I really need help guyz, if anyone can tell me y won't it work, i will b very grateful.
Now for the code:
This is my transportLayer class, handling all SmtpClient methods.
|All times are GMT +5.5. The time now is 14:18.|