0

Busy creating a bulk mail system. need to understand how to send mail using MailSystem.Net ActiveUp.Net.Mail.SmtpClient class.

I want to know that the message was delivered when the send process completes, or if it is bouncing back.

How do I achieve that?

I've got this far, but not sure how to use the AsyncCallback in code?

[WebMethod]
public void PostMail(string address, string addressName, string fromAddress, string fromName)
{
    Message message = new Message();
    message.Subject = "Test";
    message.From = new Address(fromAddress, fromName);
    message.To.Add(address, address);
    message.BodyText.Text = "Hello this is a test!";

    SmtpClient smtp = new SmtpClient();

    IAsyncResult result = ActiveUp.Net.Mail.SmtpClient.BeginSend(message, "", 110, AsyncCallback);
}

Would the AsyncCallback get a response to say that the mail bounced if it did?

CypherNet
  • 53
  • 1
  • 10
  • It would help if you also posted what library you are using for your smtp client. Also who should be getting a return and how? If you execute an async action you have to block your caller so you can return a result unless you want to serve the result only when asked, then the client could call back later if interested but you have to serve the result based on a key or something. – Igor Apr 20 '16 at 19:29
  • @Igor, using MailSystem.Net library. I want to get a result to know if the mail bounces as I am sending it. Thanks for you input. – CypherNet Apr 20 '16 at 19:44

0 Answers0