anyone has a working example of how cdont work?
thanxs
Printable View
anyone has a working example of how cdont work?
thanxs
Hi LoverPal
Using CDONTS in asp is quite easy, just use the following code
Hope it helpsCode:Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
'set its properties
objCDOMail.From = 'Email address that you want it from
objCDOMail.To = 'who you want to send it to
objCDOMail.Subject = 'any string
objCDOMail.Body = 'anystring
'send the mail
objCDOMail.Send
'set the object = nothing
Set objCDOMail = Nothing
Ian
Here is an example for the JavaScript and or JScript.
Code:var oMail;
// get a mail object
oMail = Server.CreateObject ( 'CDONTS.NewMail' );
oMail.From = sFromEmail;
oMail.To = sToEmail;
oMail.Bcc = sBccEmail;
oMail.Importance = 1;
// if you want HTML mail...
// uncomment the next two lines
// oMail.BodyFormat = 0;
// oMail.MailFormat = 0;
// if you want to attach a file...
// uncomment the next line
// oMail.AttachFile ( 'c://autoexec.bat' );
oMail.Subject = sSubject;
oMail.Body = sBody;
// send it
oMail.Send ();
I would like to use the built in SMTP server that comes with windows 2k Server but it won't forward emails to other email addresses.
I was thinking that it might be possible since when u create users in the Active Dir, there's a field for email address.
How can I get the SMTP server to send mail to that email field??
if its not possible the way win 2k server comes, any recommendations to begin coding?
Hi,
If you are having Win2k, then u can use CDO object to
configure SMTP server.
.....
objMessage = Server.CreateObject("CDO.Message")
Set objConfiguration = Server.CreateObject("CDO.Configuration")
Set colFields = objConfiguration.Fields
colFields(cdoSendUsingMethod) = cdoSendUsingPort
colFields(cdoSMTPServer) = "Your Mail Server"
colFields(cdoSMTPConnectionTimeout) = 10
colFields(cdoSMTPAuthenticate) = cdoAnonymous
sonia