Go Premium for a chance to win a PS4. Enter to Win


e-mail in ASP using WinSock ActiveX control

Posted on 1999-01-06
Medium Priority
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="/adovbs.inc"-->
     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-   telesys.com>" & VBCRLF

     strData="RCPT TO :<prathaban@enterprise-telesys.com>" & VBCRLF

     strData="DATA" & VBCRLF

     strData="TO :prathaban@enterprise-telesys.com" & VBCRLF

     strData="FROM :prathaban@enterprise-telesys.com" & VBCRLF

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

     strData="MESSAGE_ID:123@e.com" & 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 www.dimac.net.  It is a free mailer and works GREAT.  They have good examples too.
LVL 10

Accepted Solution

MasseyM earned 280 total points
ID: 1857781
Check out dimac.net and download JMail.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
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.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

783 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