Showing posts with label sending. Show all posts
Showing posts with label sending. Show all posts

Saturday, March 24, 2012

html email not sending properly

Is there anything wrong with this ? I can't figure out why it does not work properly. I receive the email, but when I open the email in outlook express I see the HTML and BODY tags as plain text.

Am I doing something wrong? All my other emails seem to send fine.

Thanks for any assistance.

mike123

Dim objMail As New MailMessage()
objMail.BodyFormat = MailFormat.Html
SmtpMail.Send("bob@dotnet.itags.org.hotmail.com", "admin@dotnet.itags.org.123.com", "subject", "<html><body><br><br>Username: <a href='http://www.123.com/a.aspx?userID=" & CStr(Session("id#")) & "' target='_blank'>" & CStr(Session("id")) & "</a><br><br>" & Request.Form("message") & "</body></html>")
objMail = Nothing

hello,

The way you are using the SmtpMail.Send would ignore objmail making it obsolete and useless...

try:


Dim objMail As New MailMessage()

objMail.BodyFormat = MailFormat.Html

objMail.To = "whoever@.mail.com"
objMail.From = "whoeveritsfrom@.mail.com"

objMail.Subject = "Subject Line"
objMail.Body = "<html><body>YOUR HTML HERE</BODY></HTML
SmtpMail.Send(objMail)

objMail = Nothing

Hope that helps
The version of SmtpMail.Send you are calling is only a shortcut that sends its own mail message. Under the covers, it creates a MailMessage object, fills it with the parameters you passed in, and sends it. So, it does not use the MailMessage object you created just before calling SmtpMail.Send. And, this method assumes the body type is text.

Instead, you should fill in the MailMessage object you created, and pass it into SmtpMail.Send, as follows:


Dim objMail as New MailMessage()
objMail.BodyFormat = MailFormat.Html
objMail.From = "bob@.hotmail.com"
objMail.To = "admin@.123.com"
objMail.Subject = "subject"
objMail.Body = "......"
SmtpMail.Send(objMail)

awesome, thanks!

Wednesday, March 21, 2012

HTML Body

Hello,
I am sending an email in HTML format.
How can I make the body text to be Arial and 12 px size?
Thank You,
Migueluse style or stylesheet.
if client is browser based (yahoo/hotmail) it may break some of the UI.
alternatively you can use style attribute for each of your HTML
elements.
shapper wrote:
> Hello,
> I am sending an email in HTML format.
> How can I make the body text to be Arial and 12 px size?
> Thank You,
> Miguel

HTML Body

Hello,

I am sending an email in HTML format.
How can I make the body text to be Arial and 12 px size?

Thank You,
Migueluse style or stylesheet.

if client is browser based (yahoo/hotmail) it may break some of the UI.
alternatively you can use style attribute for each of your HTML
elements.

shapper wrote:

Quote:

Originally Posted by

Hello,
>
I am sending an email in HTML format.
How can I make the body text to be Arial and 12 px size?
>
Thank You,
Miguel