Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS.NewMail doesn't work

Status
Not open for further replies.

ASPVB

Programmer
Jul 27, 2002
32
US

I have been write this code in my ASP page:

sub SendMessage()
on error resume next
Dim objMsg
set objMsg = Server.CreateObject("CDONTS.NewMail")
objMsg.From = EmailFrom
objMsg.To = strTo
objMsg.Subject = strSubject
objMsg.Body = strMessage
objMsg.Send
set objMsg = Nothing
End Sub

But nothing happen when I run it (even online) !!!
Does somebody can help me ?
 
Well are you running the sub? (just checking)

ie:

<%

Call SendMessage

%>

Also you could be getting an error message, but since you have &quot;on error resume next&quot; in your code it won't display an error, it just skips it.. if you get a error message after removing that line, post the error. www.vzio.com
star.gif
if I helped. [wink]
 
You didn't set the &quot;MailFormat&quot; property.

It should either be &quot;CdoMailFormatMime&quot;, which is 0. Or &quot;CdoMailFormatText&quot;, which is 1.

e.g. objMsg.MailFormat = 0

Good luck.

Min.
 
No drends it's doesn't help ! I still don't have sended message in my EmailBox after I have been run this sub !
 
No frends it's doesn't help ! I still don't have sended message in my EmailBox after I have been run this sub !
 
Is there any value in your variables:
EmailFrom, strTo, strSubject and strMessage?


Just wondering.

 
Is there any value in your variables:
EmailFrom, strTo, strSubject and strMessage?


Just wondering.

 
On an off chance,
in order for CDONTS to work properly you have toi have a default enmail asccount setup somewhere (outlook, outlook express, etc) so that the CDONTS object knows what SMTP server to send the message to. Without a default SMTP server it doesn't know where to send the message. If you don't have a mail program setup, do so, you don't have to set it to collect mail from anywhere, only so long as it has a default SMTP server.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Tarwn !
I think you are right!
I never did any setups (no outlook, outlook express, etc)!
But I thought Email will go to address in the web .
I mean I did :
objMsg.From = something@something.com
objMsg.To = myMailbox_In_Internet.com

---------------------------------------------------------
Now If that not so complicate ! Can you explain what I
have to do!?
Thanks ...........
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top