Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: HTML formatting in email


Message #1 by "StephenB" <stephenb@w...> on Tue, 9 Jan 2001 15:19:11 -0000
From: "Matthew" <mlohr@t...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: HTML formatting in email

Date: 08 January 2001 20:14





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page





(Note this thread is copied from another forum for archive purposes - there are already answers - moderator)



---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #2 by "StephenB" <stephenb@w...> on Tue, 9 Jan 2001 15:39:40 -0000

From: "Alex Shiell, ITS, EC, SE" <alex.shiell@s...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: RE: HTML formatting in email

Date: 08 January 2001 12:06





It should be sufficient to pass the HTML string in as the message content

and change the MIME type to HTML.  How you would actually do this depends on

the email sending package.



-----Original Message-----

From: Matthew [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 8:15 PM

To: ASP Web HowTo

Subject: [asp_web_howto] HTML formatting in email





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page











---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #3 by "StephenB" <stephenb@w...> on Tue, 9 Jan 2001 15:40:00 -0000

From: "Matthew Lohr" <mlohr@t...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: RE: HTML formatting in email

Date: 08 January 2001 13:11





I am using cdo



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Monday, January 08, 2001 7:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: HTML formatting in email





It should be sufficient to pass the HTML string in as the message content

and change the MIME type to HTML.  How you would actually do this depends on

the email sending package.



-----Original Message-----

From: Matthew [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 8:15 PM

To: ASP Web HowTo

Subject: [asp_web_howto] HTML formatting in email





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page













---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #4 by "StephenB" <stephenb@w...> on Tue, 9 Jan 2001 15:40:15 -0000

From: "Ryan vd Merwe (WebGecko)" <ryan@w...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: RE: HTML formatting in email

Date: 08 January 2001 13:55





Hi



Using CDONTS you'd do it like this.





<%

Email = "bob@b..."

Subject= "Hi"



' convert html into a string called Body

Body = "<table width=600 border=0 cellspacing=2 cellpadding=4 align=center

valign=TOP>" &_

"<tr>" &_

"<td align=left><b>Hi this is an html formatted email</b></td>" &_

"</tr>" &_

"</table>"



' send e-mail



set NewMailObj = server.CreateObject("CDONTS.NewMail")

NewMailObj.From = "Ryan"

NewMailObj.BodyFormat = CdoBodyFormatHTML

NewMailObj.MailFormat = CdoMailFormatMime

NewMailObj.to =  Email

NewMailObj.Subject = subject

NewMailObj.Body = Body

NewMailObj.Send

Set NewMailObj = Nothing

%>





The key is to convert your email body into a string



-----Original Message-----

From: Matthew [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 10:15 PM

To: ASP Web HowTo

Subject: [asp_web_howto] HTML formatting in email





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page











---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #5 by "StephenB" <stephenb@w...> on Tue, 9 Jan 2001 15:40:35 -0000

From: "Unterste, Andreas" <unterste@d...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: RE: HTML formatting in email

Date: 08 January 2001 15:20





Build the total HTML code for the entire email (from <HTML> to </HTML>) into

a string and then something like this



Dim objNewMail

Set objNewMail 

Server.CreateObject("CDONTS.NewMail")

objNewMail.From = "somebody@s..."

objNewMail.To = "somebody_else@s..."

objNewMail.Subject = "HTML email !"

objNewMail.BodyFormat = 0

'This is key

objNewMail.MailFormat = 0

'This is key

objNewMail.Body = HTMLtext

objNewMail.Send

set objNewMail = Nothing





Andreas





-----Original Message-----

From: Matthew Lohr [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 14:12

To: ASP Web HowTo

Subject: [asp_web_howto] RE: HTML formatting in email





I am using cdo



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Monday, January 08, 2001 7:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: HTML formatting in email





It should be sufficient to pass the HTML string in as the message content

and change the MIME type to HTML.  How you would actually do this depends on

the email sending package.



-----Original Message-----

From: Matthew [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 8:15 PM

To: ASP Web HowTo

Subject: [asp_web_howto] HTML formatting in email





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page









---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #6 by "StephenB" <stephenb@w...> on Tue, 9 Jan 2001 15:41:08 -0000

From: "Matthew Lohr" <mlohr@t...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: RE: HTML formatting in email

Date: 08 January 2001 17:34





thanks works great



-----Original Message-----

From: Ryan vd Merwe (WebGecko) [mailto:ryan@w...]

Sent: Monday, January 08, 2001 8:55 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: HTML formatting in email





Hi



Using CDONTS you'd do it like this.





<%

Email = "bob@b..."

Subject= "Hi"



' convert html into a string called Body

Body = "<table width=600 border=0 cellspacing=2 cellpadding=4 align=center

valign=TOP>" &_

"<tr>" &_

"<td align=left><b>Hi this is an html formatted email</b></td>" &_

"</tr>" &_

"</table>"



' send e-mail



set NewMailObj = server.CreateObject("CDONTS.NewMail")

NewMailObj.From = "Ryan"

NewMailObj.BodyFormat = CdoBodyFormatHTML

NewMailObj.MailFormat = CdoMailFormatMime

NewMailObj.to =  Email

NewMailObj.Subject = subject

NewMailObj.Body = Body

NewMailObj.Send

Set NewMailObj = Nothing

%>





The key is to convert your email body into a string



-----Original Message-----

From: Matthew [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 10:15 PM

To: ASP Web HowTo

Subject: [asp_web_howto] HTML formatting in email





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page









---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #7 by "StephenB" <stephenb@w...> on Tue, 9 Jan 2001 15:41:33 -0000

From: "Scott Watermasysk" <swatermasysk@C...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: RE: HTML formatting in email

Date: 08 January 2001 18:36





I use ASPMail which works pretty well. I also know some people that use

CDONTS and they don't really have any complaints.



-Scott



-----Original Message-----

From: Matthew [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 3:15 PM

To: ASP Web HowTo

Subject: [asp_web_howto] HTML formatting in email





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page











---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #8 by Aftab Ahmad <aftab.ahmad@k...> on Tue, 9 Jan 2001 17:11:13 +0100
First of all include the below dll file in global.asa



<!--METADATA TYPE="TypeLib" NAME="Microsoft CDO for NTS 1.2 Library"

	UUID="{0E064ADD-9D99-11D0-ABE5-00AA0064D470}" VERSION="1.2" -->



Now use the below code. I hope it will work



<%

Dim strRef,intpos,objSendMail





	Set objSendMail = CreateObject("CDONTS.NewMail")





	objSendMail.From="mushtaqpk@h..."

	objSendMail.To	="phlegmatic2@y..."

	objSendMail.Subject="Test mail"

	objSendMail.Body="Here you can use <b>HTML tags</b>"

	objSendMail.MailFormat=CdoMailFormatMIME

	objSendMail.Send



	Set objSendMail = Nothing



response.write "mail sent to phlegmatic2@y..."

%>





-----Original Message-----

From: StephenB [mailto:stephenb@w...]

Sent: 9. januar 2001 16:40

To: ASP CDO

Subject: [asp_cdo] RE: HTML formatting in email







From: "Matthew Lohr" <mlohr@t...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Subject: RE: HTML formatting in email

Date: 08 January 2001 13:11





I am using cdo



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Monday, January 08, 2001 7:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: HTML formatting in email





It should be sufficient to pass the HTML string in as the message content

and change the MIME type to HTML.  How you would actually do this depends on

the email sending package.



-----Original Message-----

From: Matthew [mailto:mlohr@t...]

Sent: Monday, January 08, 2001 8:15 PM

To: ASP Web HowTo

Subject: [asp_web_howto] HTML formatting in email





How do I go about sending HTMl formatted emails.  I have a form in which I

enter the contents of the email and want to send it out formatted as a web

page





---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to asp_cdo as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_cdo-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index