cdonts email text (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


rickyzicky -> cdonts email text (10/23/2002 12:29:54)

I have a for that submits to a confirmation page that also sends an email.
Everything works well, but I have 2 minor issues.

I have a line that is very long and can' t seem to break it up into multiple lines without returning errors.

Also, I would like to be able to control the font in the email to be larger or bolder etc.. Can this be accomplished easy?

Here is the code in question.

The " MYBody" line is the long one i need to break up and I' d like to make the " request.form emailaddress" bold
------------------------------------------------------------------------------

<%

Set MyCDONTSMail = CreateObject(" CDONTS.NewMail" )
MyCDONTSMail.From= request.form(" emailaddress" )
MyCDONTSMail.To= " wachasay@rochester.rr.com"
MyCDONTSMail.Subject=" Children' s Christmas Party"

' -----------------------------------------------------------------------------------
MyBody = request.form(" R1" ) &" :" & vbCrLf &request.form(" adult" )&" : " &request.form(" emailaddress" )& vbCrlf &request.form(" name1" )&" :" &request.form(" age1" )& vbCrLf &request.form(" name2" )&" :" &request.form(" age2" ) & vbCrLf &request.form(" name3" )&" :" &request.form(" age3" )& vbCrLf &request.form(" name4" )&" :" &request.form(" age4" )& vbCrLf &request.form(" name5" )&" :" &request.form(" age5" )& vbCrLf
' -----------------------------------------------------------------------------------




bobby -> RE: cdonts email text (10/23/2002 12:35:19)

How about this:

MyBody = request.form(" R1" ) 
MyBody = MyBody & " :"  & vbCrLf & request.form(" adult" )
MyBody = MyBody & " : <b>"  & request.form(" emailaddress" ) & " </b>"  & vbCrlf 
MyBody = MyBody & request.form(" name1" )
 

etc... etc...


See if that works...





rickyzicky -> RE: cdonts email text (10/23/2002 12:42:24)

No..it comes out as text.

Thanks




bobby -> RE: cdonts email text (10/23/2002 12:48:32)

Since I don' t send html emails (which you need to do in order to bold the text) I' m not sure about this, but here goes...

You may need to add <html> to the top of your email page, just like a web page... that way the email client knows it contains html. Possibly <head> and <body> as well...

Which means that you may need to close them too...

Try placing this first:

MyBody = " <html><head></head><body>"

And this last:

MyBody = MyBody & " </body></html>"

That might solve it, again I' m not positive...

Note: anyone who only allows plain text emails will see all of your html code as text, much like you are now. You might double check and make sure you' re able to receive html emails... I know that seems elementary, but I threw it out there just in case... [:p]

A lot of folks are doing this for security reasons.

If that doesn' t do it I' ll petition the gods... er, the Mods for assistance...

[:)]




rdouglass -> RE: cdonts email text (10/23/2002 12:55:48)

You may be also missing the MIME and BODY types. Try using this:

Set myMail = CreateObject(" CDONTS.NewMail" )
myMail.BodyFormat = 0
myMail.MailFormat = 0

MyCDONTSMail.From= request.form(" emailaddress" )
.......

But, yeah, as bobby said, you' ll usually need to ' build' a HTML page....

EDIT: Here is a pretty good page I refer to if sending HTML thru CDONTS.




rickyzicky -> RE: cdonts email text (10/23/2002 13:45:12)

Thanks for the help. I' ll give it a shot and check back.

RZ




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.347656E-02