472,143 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

sending email from asp page???

Hi All,,

I used this code to send an email to anyone, from my asp page, which accepts email address from the users of the form:

Sending a text e-mail using a remote server:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="smtp.server.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>
================================================== ===

Now in the place of this line: myMail.TextBody="This is a message."

I want to customize a long text data ...instaed of just using "This is a message"....

Please suggest me on this. I tried using::myMail.CreateHTML Body:"...the long text". But it gives an error saying- asp page contains more than one html body, etc...


Please suggest me what I can do about this...All I want to do is to customize and send a message that I want to, instead of just using"This is a message" , in the email.
May 18 '07 #1
3 1406
I'm not sure if I understand your question properly.. But if you wish to send a more complete message, simply dim a var with your message and assign it to TextBody. For instance:

Dim MyLongMessage
MyLongMessage = "This is a long message to sends out a marketing email. It's very long... I talk about a lot of stuff here."

myMail.TextBody = MyLongMessage

Is that what you're looking for?

Anthony
simplesoftsolutions.com
May 18 '07 #2
I'm not sure if I understand your question properly.. But if you wish to send a more complete message, simply dim a var with your message and assign it to TextBody. For instance:

Dim MyLongMessage
MyLongMessage = "This is a long message to sends out a marketing email. It's very long... I talk about a lot of stuff here."

myMail.TextBody = MyLongMessage

Is that what you're looking for?

Anthony
simplesoftsolutions.com
===========================


Dear Anthony,

Thanks for the reply first of all!!!

I think it is close to what I am looking for..

But can I add one more question into this? I want - MyLongMessage to be displayed as you said, but can I add a URL into this MyLongMessage, which varies with one and another email address that I enter in the form?
----------------Scenario is something like this----------

DB Record 1: me@mydomain.com www.google.com

In the asp form- I enter me@mydomain.com.....click on submit- it will send me an email ....which includes...."MyLongMessage" along with www.google.com, somewhere inside the MyLongmessage...Is it possible???

Thanks
Tanya
May 18 '07 #3
===========================


Dear Anthony,

Thanks for the reply first of all!!!

I think it is close to what I am looking for..

But can I add one more question into this? I want - MyLongMessage to be displayed as you said, but can I add a URL into this MyLongMessage, which varies with one and another email address that I enter in the form?
----------------Scenario is something like this----------

DB Record 1: me@mydomain.com www.google.com

In the asp form- I enter me@mydomain.com.....click on submit- it will send me an email ....which includes...."MyLongMessage" along with www.google.com, somewhere inside the MyLongmessage...Is it possible???

Thanks
Tanya
===============================================

Anyone familiar with such scenario ,please suggest me on this...Thanks for your time!!

-Tanya
May 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by festivalman | last post: by
6 posts views Thread by Eduardo Rosa | last post: by
4 posts views Thread by Roger Withnell | last post: by
8 posts views Thread by Marty | last post: by
1 post views Thread by runway27 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.