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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
site launch date and last modified date 3 83
How search webpage "viewable text" only 1 63
Remove lines by logo 2 23
When should I use a controller? 3 22
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

867 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

14 Experts available now in Live!

Get 1:1 Help Now