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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

710 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