Designing an Email application
-
I am trying to understand how to send HTML emails to the users. The content of the emails can vary according to the users, e.g.: Dear [CustomerName] Thanks for your orders. Your order number is [OrderNumber]..... How can I create / manage email content such as above. I am also interested to know how does Amazon create their emails. Because the whole content of their emails is tailored for each individual customer. Thanks
-
I am trying to understand how to send HTML emails to the users. The content of the emails can vary according to the users, e.g.: Dear [CustomerName] Thanks for your orders. Your order number is [OrderNumber]..... How can I create / manage email content such as above. I am also interested to know how does Amazon create their emails. Because the whole content of their emails is tailored for each individual customer. Thanks
Hey, Check out Syed Moshiur Murshed's tutorial for sending email using GMail[^]. in his tutorial you can see that one of the properties he configed was:
mailMsg.BodyFormat = MailFormat.Text;
MailFormat is an enum that one of his options is "HTML" that sends the email in html format (as you asked) and by using the class MailMessage you can render a html code and send it to the customer.. something like:string customerName = "....."; long customerId = 539482; string messege = "Hello " + customerName + " your Id is " + customerId.ToString() + "";
and then by using the Body property in MailMessage you can set the mail's text to the messege by using:mailMsg.Body = messege; //assuming mailMsg is the object of MailMessage
Hope I helped... Good luck :-) Tal Kain.