amazon web services - How to get response from SES when using C# SMTP API -
the .net smtpclient's send
method returns void. throws 2 exceptions, smtpexception
, failuretosendtorecipientsexception
(or that).
when using ses, successful email delivery ses sends 200 ok message message id. message id needs tracked.
how do using c# smtp api?
edit: smtp protocol mentions various response codes sent smtp server. looking smtp library exposes "final" response code caller. aware of ses http api. not looking use moment.
have tried amazon ses (simple email service) c# wrapper?
it has sendemail method returns class messageid:
public amazonsentemailresult sendemail(string toemail, string senderemailaddress, string replytoemailaddress, string subject, string body) { list<string> toaddresslist = new list<string>(); toaddresslist.add(toemail); return sendemail(this.awsaccesskey, this.awssecretkey, toaddresslist, new list<string>(), new list<string>(), senderemailaddress, replytoemailaddress, subject, body); } public class amazonsentemailresult { public exception errorexception { get; set; } public string messageid { get; set; } public bool haserror { get; set; } public amazonsentemailresult() { this.haserror = false; this.errorexception = null; this.messageid = string.empty; } }
i dont think can messageid system.net.mail.smtpclient
need use amazon.simpleemail.amazonsimpleemailserviceclient
per amazon ses sample: http://docs.aws.amazon.com/ses/latest/developerguide/send-using-smtp-net.html
Comments
Post a Comment