Click to See Complete Forum and Search --> : sending mails using cdont
loverpal
Mar 14th, 2001, 11:35 PM
anyone has a working example of how cdont work?
thanxs
Ianpbaker
Mar 15th, 2001, 03:32 AM
Hi LoverPal
Using CDONTS in asp is quite easy, just use the following code
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
Hope it helps
Ian
Here is an example for the JavaScript and or JScript.
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 ();
hydr0p0nix
Mar 16th, 2001, 12:14 PM
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?
harsoni
Mar 16th, 2001, 12:42 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.