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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending mails using CDO in Asp

Status
Not open for further replies.

oops4me

Programmer
Jul 7, 2003
50
IN
hello,
I am using winxp as os. i am having IIS installed & have taken SMTP services.i am not having SMTP server. can i send mails without SMTP sever. i ve written following coding in my asp page.

Const cdoOutlookExvbsss = 2
Const cdoIIS = 1

' Dim Message As New CDO.Message

'Create CDO message object
Set Message = CreateObject("CDO.Message")
With Message
'Load IIS configuration
.Configuration.Load cdoIIS

'Set email adress, subject And body
.To = aTo
.Subject = Subject
.TextBody = TextBody

'Set sender address If specified.
If Len(aFrom) > 0 Then .From = aFrom

'Send the message
.Send
End With

is this code is correct. please tell me how tosend mails with CDO. & if i don't have SMTP server then how i can send mails.
ajay

 
hello,

thanx for ur help. but on above link, the code which is given requires SMTP server on web. I am not having SMTP server on web. can it is possible to send mails without using SMTP server? can it possible to send a mail just using SMTP services present in IIS? if possible then please give me the code.

thank u
 
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000- 00AA006D2EA4" NAME="ADODB Type Library" -->
<%
Dim objCDO
Dim iConf
Dim Flds
Dim strSub
'Const cdoSendUsingPort = 2

Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

With Flds
.Item(cdoSendUsingMethod) = 2
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With

Set objCDO.Configuration = iConf
objCDO.From = "fill in from address"
objCDO.To = "fill in to address"
objCDO.Subject = "fill in subject"
objCDO.TextBody = "fill in message body"
objCDO.Send
Set ObjCDO = Nothing
Set iConf = Nothing
End If
%>

This should send out the email via port 25 on the client side. Good Luck -
 
Something you should be aware of, almost all personal internet providers block port 25 which you need open to send emails like you describe. Unless you have a business grade internet connection then it won't work.
 
This is becoming a widely used method by ISPs of preventing home broadband users machines from broadcasting spam when they get hit by viruses and trojans.

I just move CDO related elements to some live demo server for testing and it works fine.

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top