Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Mail in HTML Format

Reply
Thread Tools

Mail in HTML Format

 
 
Neel
Guest
Posts: n/a
 
      11-11-2003
Hi

I have a webpage in asp.net on submit sends an email, I
want the body of the message to be in the HTML format.

what I am doing is creating an object of
say
oMailMessage = New Mail.MailMessage()

With oMailMessage

'set required parameters
.From =
.To =
.Subject =
.Body =
.BodyFormat = MailFormat.Html

End Withwith

but still I am getting an email in the text format,

can anyone suggest me at the earliest, thanks in advance

 
Reply With Quote
 
 
 
 
Jason
Guest
Posts: n/a
 
      11-19-2003
You should just add html to the body and it should work.

Here's an example from an old project:

StringBuilder body = new StringBuilder("<html><body><table
bgcolor='#DCDCDC'><tr bgcolor='#EEEEEE'><td>Message From: </td><td>");

body.Append(EmailName.Text);

body.Append("</td></tr><tr><td>Login User Name: </td><td>");

body.Append(Context.User.Identity.Name);

body.Append("</td></tr><tr bgcolor='#EEEEEE'><td>Starting Date: </td><td>");

body.Append(Calendar1.SelectedDate.ToShortDateStri ng());

body.Append("</td></tr><tr><td>StartTime: </td><td>");

body.Append(EmailStartTime.SelectedItem.ToString() );

body.Append("</td></tr><tr bgcolor='#EEEEEE'><td>EndTime: </td><td>");

body.Append(EmailEndTime.SelectedItem.ToString());

body.Append("</td></tr><tr><td>Description: </td><td>");

body.Append(EmailDescription.Text);

body.Append("</td></tr><tr bgcolor='#EEEEEE'><td>Network Cables:
</td><td>");

body.Append(NetworkCables.Text);

body.Append("</td></tr><tr><td>Extension Cords: </td><td>");

body.Append(ExtensionCords.Text);

body.Append("</td></tr><tr bgcolor='#EEEEEE'><td>Flip Charts: </td><td>");

body.Append(FlipCharts.Text);

body.Append("</td></tr><body><html></table>");

msg.Body = body.ToString();


"Neel" <> wrote in message
news:10a601c3a895$f4970fc0$...
> Hi
>
> I have a webpage in asp.net on submit sends an email, I
> want the body of the message to be in the HTML format.
>
> what I am doing is creating an object of
> say
> oMailMessage = New Mail.MailMessage()
>
> With oMailMessage
>
> 'set required parameters
> .From =
> .To =
> .Subject =
> .Body =
> .BodyFormat = MailFormat.Html
>
> End Withwith
>
> but still I am getting an email in the text format,
>
> can anyone suggest me at the earliest, thanks in advance
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mail the file in html format ? Amit Kumar Java 1 03-13-2007 09:59 AM
mail the file in html format ? Amit Kumar Java 0 03-13-2007 04:52 AM
Is Yahoo! Mail Sending Format HTML or Plain Text? ZaMir Computer Support 31 05-18-2004 09:08 AM
can't send mail in html format Ofir Amitai ASP .Net 2 08-19-2003 10:37 PM
How to send mail in HTML format Paul Turley ASP .Net 2 07-29-2003 05:43 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57