e-mail in ASP using WinSock ActiveX control

Posted on 1999-01-06
Last Modified: 2013-12-25

   I am trying to send mail in my ASP program by using WinSock control.The code I am using is

<!--#include virtual="/"-->
     Dim str1
     set conn=Server.CreateObject("MSWinSock.WinSock.1")
     conn.RemoteHost = ""
     conn.RemotePort = 25
->   conn.GetData str1
     strData= "HELO DHYAN" & VBCRLF
     conn.SendData strData
     conn.GetData str1

     strData= "MAIL FROM :<prathaban@enterprise->" & VBCRLF

     strData="RCPT TO :<>" & VBCRLF

     strData="DATA" & VBCRLF

     strData="TO" & VBCRLF

     strData="FROM" & VBCRLF

     strData="SUBJECT :Hello!!!" & VBCRLF

     strData="" & VBCRLF

     strData= "From=" & From & ",Address1=" & Address1 & VBCRLF  

     strData="." & VBCRLF

     strData="QUIT" & VBCRLF


   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.



Question by:prats_sr
  • 2

Expert Comment

ID: 1857779
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 ?
LVL 10

Expert Comment

ID: 1857780
Agree with PBall.  I recommend  It is a free mailer and works GREAT.  They have good examples too.
LVL 10

Accepted Solution

MasseyM earned 70 total points
ID: 1857781
Check out and download JMail.

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now