Click to See Complete Forum and Search --> : IIS Configuration for Sending Mail using CDONTS


bharadwajrv
September 26th, 2002, 12:32 AM
Hi,
i'm using CDONTS.Newmail, object to send the mails to the extranal account like me@mywebsite.com.. but the mails are not delivered to the given account.

is there any configuration is required to be done in the IIS server for SMTP server to send the mails..

the code is

dim mail
set mail = Server.CreateObject("CDONTS.Newmail")
mail.From = "me@mysite.com"
mail.To = "you@yoursite.com"
mail.Subject = "This is a test mail"
mail.Body = "This a test mail body"
mail.Send

Response.Write "<br>U'r mail is sent"


Thanks in adv.
Venu

MRutledge
September 28th, 2002, 08:35 PM
All you have to do is have the SMPT Service installed and running in order for it to work...

bharadwajrv
September 30th, 2002, 01:04 AM
Hi,
SMTP is installed and it is running ver much..
still i'm not able to send the mails...

is there any other software required to acheive this...

Thanks in adv.
Venu Bharadwaj

MRutledge
September 30th, 2002, 01:21 AM
it may be working but you may not be getting the mail....the from address and to address must be valid e-mails...look in the inetpub directory and see if there are any mails waiting in the queue or if there are any mails in the bad mail folder....

here is the code I use to send emails and it looks like you are also doing it right. so my guess is that you arent specifying valid emails....


Function sendEmail(strTo, strFrom, strSubject, strBody, emailType)
Dim objCDO

Set objCDO = Server.CreateObject("CDONTS.NewMail") ' Create a new mail object
objCDO.To = strTo ' Specify To address
objCDO.From = strFrom ' Specify From address
objCDO.Subject = strSubject ' Specify Subject
objCDO.BodyFormat = emailType ' Specify email type -- 0 HTML
objCDO.MailFormat = emailType ' Specify email type -- 0 HTML
objCDO.Body = strBody ' Put content in
objCDO.Send ' Send the email
Set objCDO = Nothing ' Deallocate mail object
End Function


Matt

zeza
September 30th, 2002, 10:53 AM
I tried the code but it does not work out

the error tell me that "email object could not be created


would you pls tell me where can I declare the function and when can I call it