J
Jeff
hi
asp.net 3.5
I'm wonder how to send html mail in asp.net 3.5 where the body is based on a
templatefile.
#Question 1:
Can the templatefile be an .aspx webpage, suppose I have this webpage
~/Email/ReportTemplate.aspx?,
(if possible, then how is it done? just a short example or link and I can
think of the rest myself)
#Question 2:
Do I need to do something special to incorperate graphics in the email?
#Question 3:
At http://forums.asp.net/t/1387177.aspx I found this code:
Random caseNumber = new Random();
NetworkCredential loginInfo = new
NetworkCredential("(e-mail address removed)", "YourGmailPassword");
MailDefinition md = new MailDefinition();
md.From = "SomeEmailAccount";
md.Subject = "Your Support Case";
md.BodyFileName = "~/EmailTemplates/email.txt";
md.IsBodyHtml = true;
ListDictionary placeholder = new ListDictionary();
placeholder.Add("<%DateTime%>", DateTime.Now.ToString("MMM dd, yyyy
hh:mmtt"));
placeholder.Add("<%CaseNumber%>", caseNumber.Next(10000, 99999).ToString());
placeholder.Add("<%Website%>", "xyz.com");
MailMessage msg = md.CreateMailMessage("SomeUserEmailAddress", placeholder,
this);
- why does "MailMessage msg = md.CreateMailMessage("SomeUserEmailAddress",
placeholder, this); " contain "this" as a paramter?
asp.net 3.5
I'm wonder how to send html mail in asp.net 3.5 where the body is based on a
templatefile.
#Question 1:
Can the templatefile be an .aspx webpage, suppose I have this webpage
~/Email/ReportTemplate.aspx?,
(if possible, then how is it done? just a short example or link and I can
think of the rest myself)
#Question 2:
Do I need to do something special to incorperate graphics in the email?
#Question 3:
At http://forums.asp.net/t/1387177.aspx I found this code:
Random caseNumber = new Random();
NetworkCredential loginInfo = new
NetworkCredential("(e-mail address removed)", "YourGmailPassword");
MailDefinition md = new MailDefinition();
md.From = "SomeEmailAccount";
md.Subject = "Your Support Case";
md.BodyFileName = "~/EmailTemplates/email.txt";
md.IsBodyHtml = true;
ListDictionary placeholder = new ListDictionary();
placeholder.Add("<%DateTime%>", DateTime.Now.ToString("MMM dd, yyyy
hh:mmtt"));
placeholder.Add("<%CaseNumber%>", caseNumber.Next(10000, 99999).ToString());
placeholder.Add("<%Website%>", "xyz.com");
MailMessage msg = md.CreateMailMessage("SomeUserEmailAddress", placeholder,
this);
- why does "MailMessage msg = md.CreateMailMessage("SomeUserEmailAddress",
placeholder, this); " contain "this" as a paramter?