----------------------------------------------------------- New Message on MumbaiUserGroup
----------------------------------------------------------- From: PateLJagdisH Message 11 in Discussion Hello all, As per my view the way suggested by my friend for writing the HTML mail is not good enough.. It will take more time to create the implement and also for the formating the mail, As per my view, Create one template for the mail [ like simple HTML file ] with some custome fields... Ex. <html> .... ... You are successfully registered .... Your user name: [USERNAM] Password:[PASSWORD] </html> Now runtime replace this special field with the approprite value... Using this method you have to benefits, 1: it will implement faster 2: In future if you want to chante the format or the text of the mail body then it is will be easy, faster and you can do it with out change the single line of your code... I hope this is what you want Cheers.... Jagdish Patel Software Developer 9825307671 From: "bobby_kedia" <[EMAIL PROTECTED]> Reply-To: "MumbaiUserGroup" <[email protected]> To: "MumbaiUserGroup" <[email protected]> Subject: Re: Sending HTML formatted eMail. Date: Fri, 9 Sep 2005 04:17:39 -0700 <META content="Microsoft SafeHTML" name=Generator> <STYLE> .ThmFgColumnHeader, A.FrameLink, A.HeaderLink, A.FooterLink, A.LgtCmd, A.MSNLink {color:#FFFFFF;} .ThmFgTitleLightBk {color:#FF6600;} .ThmFgSmallLight {color:#ff0000;} .ThmFgNavLink, A.NavLink, A.ChildLink:hover {color:#666699;} .ThmFgInactiveText, A.SystemLink {color:#666666;} .ThmFgFrameTitle {color:#FFFFCC;} .ThmFgMiscText, A.Cat, A.SubCat {color:#336699;} .ThmFgCommand, A.Command, A.LargeCommand, A.MsgLink {color:#003366;} .ThmFgHeader {color:#333333;} .ThmFgDivider {color:#CCCCCC;} .ThmBgStandard {background-color:#FFFFFF;} .ThmBgUnknown1 {background-color:#FF6600;} .ThmBgFraming {background-color:#666699;} .ThmBgUnknown2 {background-color:#666666;} .ThmBgHighlightDark {background-color:#FFFFCC;} .ThmBgHighlightLight, #idToolbar, #tbContents {background-color:#FFFFE8;} .ThmBgTitleDarkBk {background-color:#F1F1F1;} .ThmBgAlternate {background-color:#ECF1F6;} .ThmBgUnknown3 {background-color:#CCCCFF;} .ThmBgDivider {background-color:#CCCCCC;} .ThmBgHeader {background-color:#9999CC;} .ThmBgLinks {background-color:#8696C9;} .ThmBgSharkBar {background-color:#8696C9;} .ThmBgGlobalNick {background-color:#9394A9;} .calfgndcolor {color:#E00505;} .calbgndcolor {color:#E00505;} </STYLE> New Message on MumbaiUserGroup Sending HTML formatted eMail. Reply Reply to Sender Recommend Message 5 in Discussion From: bobby_kedia Hi, You need to use HTML Text Writer and String Writer to make the HTML body message. I have given the code example below StringWriter lobj_StringWriter =new StringWriter(); HtmlTextWriter lobj_HtmlTextWriter= new HtmlTextWriter(lobj_StringWriter); lobj_HtmlTextWriter.RenderBeginTag("html"); lobj_HtmlTextWriter.RenderBeginTag("head"); lobj_HtmlTextWriter.RenderBeginTag("title"); lobj_HtmlTextWriter.Write("Thank You !"); lobj_HtmlTextWriter.RenderEndTag(); lobj_HtmlTextWriter.RenderEndTag(); lobj_HtmlTextWriter.RenderBeginTag("body"); lobj_HtmlTextWriter.WriteLine("Dear "+FirstName.Trim()+", Welcome to due "); lobj_HtmlTextWriter.WriteLine("Your Login details are: "); lobj_HtmlTextWriter.WriteLine(" Login Id: "+UserId.ToString().Trim()); lobj_HtmlTextWriter.WriteLine(" Password: "+Password.ToString().Trim()); lobj_HtmlTextWriter.WriteLine(" Kindly use the below hyperlink to activate your account. "); lobj_HtmlTextWriter.WriteLine(" Click Here "); lobj_HtmlTextWriter.WriteLine("http://www.due.com/InvoicerAccount.aspx" ); lobj_HtmlTextWriter.WriteLine(""); lobj_HtmlTextWriter.WriteLine(" Warm Regards Due Team "); lobj_HtmlTextWriter.RenderEndTag(); lobj_HtmlTextWriter.RenderEndTag(); MailMessage Mail=new MailMessage(); Mail.To=EmailTo.Trim(); Mail.From=EmailFrom.Trim(); Mail.Subject=" Account Registration Details !!"; Mail.Body=lobj_StringWriter.ToString(); Mail.BodyFormat=MailFormat.Html; SmtpMail.Send(Mail); View other groups in this category. <STYLE> ADMSmLnk {font-family:verdana,system;color:#336699;text-decoration:none;} ADMSmLnk:hover {color:#ff6600;text-decoration:underline;} </STYLE> Also on MSN: Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. Need help? If you've forgotten your password, please go to Passport Member Services. For other questions or feedback, go to our Contact Us page. If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. Remove my e-mail address from MumbaiUserGroup. ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
