473,790 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to send e-mail via Winsock control, state remains CLOSED

36 New Member
hi for every one

i have program using to send e-mail

i enter all information to this program put i can not sending from it

please if any one can help me i waiting

note : i write the source code :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. cdInsertFile.ShowOpen
  3. txtInsertFile.Text = "c:\ReadMe.txt"
  4.  
  5.  
  6.     wsk.Protocol = sckTCPProtocol
  7.     wsk.RemoteHost = "10.00.11.11"
  8.     wsk.RemotePort = 25
  9.     wsk.Connect
  10.  
  11.     Do
  12.         DoEvents
  13.     Loop Until wsk.State = 7
  14.  
  15.     wsk.SendData ("hello flashmail" + vbCrLf)
  16.     wsk.SendData ("MAIL FROM: " & "xyx-00@hotmail.com" & vbCrLf)
  17.     wsk.SendData ("rcpt to: " & "mas490@gmail.com" & vbCrLf)
  18.     wsk.SendData ("data" & vbCrLf)
  19.     wsk.SendData ("Subject: " & "Attach file" & vbCrLf)
  20.     wsk.SendData ("read this file " & vbCrLf)
  21.     wsk.SendData ("." & vbCrLf)
  22.     wsk.SendData ("quit" & vbCrLf)
  23.     wsk.Close
  24.  
  25.  
  26.     Timer1.Interval = 1000
  27.  
  28. End Sub
  29.  
  30. Private Sub Timer1_Timer()
  31. Select Case wsk.State
  32.  
  33.     Case Is = 0: lblStat.Caption = "Closed"
  34.     Case Is = 1: lblStat.Caption = "Open"
  35.     Case Is = 2: lblStat.Caption = "Listening"
  36.     Case Is = 3: lblStat.Caption = "Connection pending"
  37.     Case Is = 4: lblStat.Caption = "Resolving host"
  38.     Case Is = 5: lblStat.Caption = "Host resolved"
  39.     Case Is = 6: lblStat.Caption = "Connecting"
  40.     Case Is = 7: lblStat.Caption = "Connected"
  41.     Case Is = 8: lblStat.Caption = "Peer is closing the connection"
  42.     Case Is = 9: lblStat.Caption = "Error"
  43.  
  44. End Select
  45.  
  46. End Sub
thank you
Apr 18 '07 #1
3 1874
ansumansahu
149 New Member
hi for every one

i have program using to send e-mail

i enter all information to this program put i can not sending from it

please if any one can help me i waiting

note : i write the source code :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. cdInsertFile.ShowOpen
  3. txtInsertFile.Text = "c:\ReadMe.txt"
  4.  
  5.  
  6.     wsk.Protocol = sckTCPProtocol
  7.     wsk.RemoteHost = "10.00.11.11"
  8.     wsk.RemotePort = 25
  9.     wsk.Connect
  10.  
  11.     Do
  12.         DoEvents
  13.     Loop Until wsk.State = 7
  14.  
  15.     wsk.SendData ("hello flashmail" + vbCrLf)
  16.     wsk.SendData ("MAIL FROM: " & "xyx-00@hotmail.com" & vbCrLf)
  17.     wsk.SendData ("rcpt to: " & "mas490@gmail.com" & vbCrLf)
  18.     wsk.SendData ("data" & vbCrLf)
  19.     wsk.SendData ("Subject: " & "Attach file" & vbCrLf)
  20.     wsk.SendData ("read this file " & vbCrLf)
  21.     wsk.SendData ("." & vbCrLf)
  22.     wsk.SendData ("quit" & vbCrLf)
  23.     wsk.Close
  24.  
  25.  
  26.     Timer1.Interval = 1000
  27.  
  28. End Sub
  29.  
  30. Private Sub Timer1_Timer()
  31. Select Case wsk.State
  32.  
  33.     Case Is = 0: lblStat.Caption = "Closed"
  34.     Case Is = 1: lblStat.Caption = "Open"
  35.     Case Is = 2: lblStat.Caption = "Listening"
  36.     Case Is = 3: lblStat.Caption = "Connection pending"
  37.     Case Is = 4: lblStat.Caption = "Resolving host"
  38.     Case Is = 5: lblStat.Caption = "Host resolved"
  39.     Case Is = 6: lblStat.Caption = "Connecting"
  40.     Case Is = 7: lblStat.Caption = "Connected"
  41.     Case Is = 8: lblStat.Caption = "Peer is closing the connection"
  42.     Case Is = 9: lblStat.Caption = "Error"
  43.  
  44. End Select
  45.  
  46. End Sub
thank you

Are you running this program behind a firewall. What is the exact error that you are getting.

-ansuman sahu
Apr 18 '07 #2
mse07
36 New Member
the problem is the winsock state is every time is close .

and i stop the firewall but i cant running .
Apr 18 '07 #3
Killer42
8,435 Recognized Expert Expert
Just a note to let you know, I'm going to change the title of this thread, so it's more helpful for later searching.
Apr 19 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2450
by: Joel Goldstick | last post by:
What is wrong with this? IT gives this error: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT pp.propertyindex, pp.photoindex FROM test AS pp JOIN ren The select portion does what I want. test is a linking table between a rentalproperties and a photos. I want to delete all the photos associated with a certain property
3
1343
by: Christian Hamel | last post by:
As said in the topic? I understand that this security has been added following many viruses out there but we have an automated system that we need to put in place that send emails. Any idea? Thanks
18
3398
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site relies on subscrption fees. Sessions ID's are matched between the browser and the server. So a users can login with same username and password and those sessions are tracked individually. Some suggest create table fields with the session ID...
7
12052
by: Shoveler | last post by:
I'm trying to send an ARP to determine different devices on the network. I need to see the MAC address of my devices on my LAN. With the MAC I can determine if I need to talk to that devices. I figured the ARP is the best we to find who is out there. I'm using C# and the Raw SocketType. I run into the WSACancelBlockingCall problem. Here's my code: Socket MyPing = new Socket(AddressFamily.InterNetwork, SocketType.Raw ,...
6
22816
by: mattc | last post by:
Hi, Writing a Macro in Excel and wanting to send emails automatically without this pop up box "A program is trying to automatically send email on your behalf". Is there some script I can use to avoid this pop up ? I'm just a beginner.... please help. Thanks !
6
32819
by: Boldgeek | last post by:
I am trying to develop an app that will allow automatic updating of a web form which uses multipart/form-data enctype (as it MIGHT be sending an image) I have an example form, which when submitted displays the results as you would expect. However when I send the same data using the PHP script I get a 400 error: Bad Request
4
3732
by: =?Utf-8?B?QWxleGFuZGVy?= | last post by:
Hi! I am new to C#. I read two C# books in the last two days which only covered the basics. And now I am on my third day. The books were really bad, because they did not cover windows applications, only ten to twenty pages how to create forms. So now you know why I want to have hotkeys in a CONSOLE Application. Is this possible? I would be glad if you could give me some links in the msdn or just the names of the functions needed. If...
1
2744
by: danfolkes | last post by:
Hey Everyone, I am trying to send repeated messages from a "Node" to a "Server". It works the first time I send the from the Node to Server, but after that it either errors, or does not do anything. I would love some help, here is the code: import socket import thread import time
3
1263
by: Zabooster | last post by:
Hi all, I have to submit a project in 2 days' time and am currently challenged trying to send information inputted into textboxes, radiobuttons and checkboxes present in different forms to a sigle row in Access. In other words, a series of forms are interlinked and the final form is supposed to send the information in all the forms (including itself) to an Access file. I'm not sure whether the connection I've created using the dataadapter in...
7
1501
by: John Straumann | last post by:
Hi all: I am trying to write some code to send an email from an Assembly file, and found some examples on MSDN. However when I run the program (I am using a console app for testing), the email does not send. I do not get an error, but nothing gets sent. The code is pasted below, any and all help is greatly appreciated. I have changed the "to" address and the password for "no spam" reasons. :)
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.