We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Mail Sending is not working


We are using Aspose.Network[Version] component to send an email. But sometimes it's working and sometimes it's not.

Please see the following code which i have written.

SMTPServerAddress[IP ADDRESS] mentioned in web.config file.

Aspose.Network.License lic = new Aspose.Network.License();
Aspose.Network.Mail.MailMessage msg1 = new Aspose.Network.Mail.MailMessage();
msg1.Subject = "ThirupathiHY";
msg1.To = "munigyalathirupathi@hotmail.com";
msg1.TextBody = "Thirupathi_New";
msg1.Sender = "munigyalathirupathi@hotmail.com";
Aspose.Network.Mail.SmtpClient client1 = new Aspose.Network.Mail.SmtpClient(System.Configuration.ConfigurationSettings.AppSettings["SMTPServerAddress"]);
client1.AuthenticationMethod = Aspose.Network.Mail.SmtpAuthentication.None;

Why it's behaving like that. If i use simple .net MailMessage class with same SMTP address,it's working fine.

I would appreciate for quick reply. Its urgent issue.

Thanks in Advance


Please try the "From" property of the MailMessage class instead of "Sender". If it does not work, please put the code in try block and post the exception here.


Thanks for early response. Eventhough we are using From instead of Sender,it's not working. One more thing if we use From instead of Sender, the receiver couldn't see the sender address in the mail list, the sender address coming as blank when mail is coming as i told sometime it's working and not sometime.Alreay TRY CATCH black implemented but we are not getting any exception.

We are using Aspose component just for encoding the subject, otherwise .net MailMessage class is better.

I hope exact solution will be received this time.

Thanks in advance,


Hi Thirupathi,

Can you please tell us your system’s environment in which you are testing this. e.g. Operating system, mail server, .Net framework version etc.

I am using the code below and its sending emails to hotmail and other servers perfectly.

Aspose.Network.Mail.MailMessage msg1 = new Aspose.Network.Mail.MailMessage();
msg1.Subject = "Subject";
msg1.To = email@domain.com;
msg1.TextBody = "text body";
msg1.From = email@domain.com;
Aspose.Network.Mail.SmtpClient client1 = new SmtpClient("smtpserverAddress", 25, ssaqib.razzaq@aspose.com", "pwd");

I am not using “Sender” here but I can see the address in mail list, both in web interface and outlook. My environment is Windows XP, Visual Studio 2005, .NET framework 2.0 and Aspose.Network 3.8

I am only doubtful in one thing that you have mentioned. “Sometimes its working and sometimes it wont”. How frequently are you running the program? Can you send some screenshot where sender address is coming blank.

I would also recommend you to use Aspose.Network 3.8 which has new features and bug fixes as well.