Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

e-mail in ASP using WinSock ActiveX control

Posted on 1999-01-06
3
Medium Priority
?
562 Views
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 = "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-telesys.com>" & VBCRLF
     conn.SendData(strData)
     conn.GetData()

     strData="DATA" & VBCRLF
     conn.SendData(strData)
     conn.GetData()

     strData="TO :prathaban@enterprise-telesys.com" & VBCRLF
     conn.SendData(strData)
     conn.GetData()

     strData="FROM :prathaban@enterprise-telesys.com" & VBCRLF
     conn.SendData(strData)
     conn.GetData()

     strData="SUBJECT :Hello!!!" & VBCRLF
     conn.SendData(strData)
     conn.GetData()

     strData="MESSAGE_ID:123@e.com" & VBCRLF
     conn.SendData(strData)
     conn.GetData()

     From=Request.Form("From")
     Address1=Request.Form("Address1")
         
     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.      
   
               

 
0
Comment
Question by:prats_sr
[X]
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
3 Comments
 
LVL 6

Expert Comment

by:PBall
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 ?
0
 
LVL 10

Expert Comment

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

Accepted Solution

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

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
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…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

715 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