prats_sr
asked on
e-mail in ASP using WinSock ActiveX control
I am trying to send mail in my ASP program by using WinSock control.The code I am using is
<!--#include virtual="/adovbs.inc"-->
<%
Dim str1
set conn=Server.CreateObject("
conn.RemoteHost = "202.54.33.194"
conn.RemotePort = 25
conn.Connect
-> conn.GetData str1
strData= "HELO DHYAN" & VBCRLF
conn.SendData strData
conn.GetData str1
strData= "MAIL FROM :<prathaban@enterprise- telesys.com>" & VBCRLF
conn.SendData(strData)
conn.GetData()
strData="RCPT TO :<prathaban@enterprise-tel
conn.SendData(strData)
conn.GetData()
strData="DATA" & VBCRLF
conn.SendData(strData)
conn.GetData()
strData="TO :prathaban@enterprise-tele
conn.SendData(strData)
conn.GetData()
strData="FROM :prathaban@enterprise-tele
conn.SendData(strData)
conn.GetData()
strData="SUBJECT :Hello!!!" & VBCRLF
conn.SendData(strData)
conn.GetData()
strData="MESSAGE_ID:123@e.
conn.SendData(strData)
conn.GetData()
From=Request.Form("From")
Address1=Request.Form("Add
strData= "From=" & From & ",Address1=" & Address1 & VBCRLF
conn.SendData(strData)
conn.GetData()
strData="." & VBCRLF
conn.SendData(strData)
conn.GetData()
strData="QUIT" & VBCRLF
conn.SendData(strData)
conn.GetData()
conn.Close
%>
I get an error when I try to getData>the error I receive is
Winsock error '800a9c46'
Wrong protocol or connection state for the requested transaction or request
Can Anyone help me thru this.
Thanks.
Why torture yourself when there are so many other ASP mailer out there - ready to be used and definitely much more simpler than trying to do it with winsock ?
Agree with PBall. I recommend www.dimac.net. It is a free mailer and works GREAT. They have good examples too.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.