|
-
Jun 28th, 2000, 06:50 PM
#1
Thread Starter
Lively Member
I want to know that if there is any option to create Email by using Telnt ( SMTP protocol ) by form .
explain :
I create a form , and when i click " send " the Application connect throw Telnet to Mailserver , and on this mailserver the mail will create it's self and will send to the recipient .
if anyone understand this , pls help me .
thank !
-
Jun 28th, 2000, 08:36 PM
#2
Fanatic Member
This is very possible (easy in fact) with the MS Winsock control.
RFC info is on the net for SMTP and POP3 so all you have to do is write a program that passes the simple commands. I have a UU encode-decode module incase you want to attach files.
have a bit of a read and if you have any trouble (specific questions) post on this thread and I'll give you a hand.
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jun 28th, 2000, 10:52 PM
#3
Addicted Member
Easy For you paul...hee hee
It is easy for you paul..but i dont have a clue as to how to use the ms winsock yet..haha..i am interested though...
:ASK DUMB QUESTION...GET DUMB ANSWER!:
-
Jun 29th, 2000, 12:57 AM
#4
New Member
Create EMail through Telnet...
OK. Here is how to do it, but this is just to get you started. Doing it this way will only work if the SMTP server accept relays! This is shown in VB but you can see the commands to send in a telnet session (just telnet to port 25 of the e-mail server)
First drop a WinSock control on the form.
Add a 2 textboxes and name them txtRecipient and txtMessage. Then add a button called cmdSend.
Add the following code under the cmdSend Click event.
Code:
If Winsock1.State <> sckClosed Then
Winsock1.Close
End If
Winsock1.Protocol = sckTCPProtocol
Winsock1.RemotePort = 25
Winsock1.RemoteHost = "Your SMTP server ie: smtp.
Winsock1.Connect
Winsock1.SendData "HELO " + SystemName + Chr$(13) + Chr$(10) 'Replace SystemName with the systems name (can really be anything)
Winsock1.SendData "MAIL FROM:" + YourEMail + Chr$(13) + Chr$(10) 'Replace YourEMail with your (sender) email address
Winsock1.SendData "RCPT TO:" + txtRecipient + Chr$(13) + Chr$(10)
Winsock1.SendData "DATA" + Chr$(13) + Chr$(10)
Winsock1.SendData txtMessage + Chr$(13) + Chr$(10) + "." + Chr$(13) + Chr$(10)
'Tip: After you type DATA, everything that follows is the email message. The message is sent when you enter a period "." on a line by itself (ie: Hit return then . then hit return)
Winsock1.SendData "QUIT" + Chr$(13) + Chr$(10)
That just sent the email. Remember that this only works if the SMTP server accepts relaying.
If you want to capture the messages sent back from the server you could add a listbox, name it lstSrvMsgs and then add the following code.
Code:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim InData As String
Winsock1.GetData InData
lstSrvMsgs.AddItem Left$(InData, Len(InData) - 2)
'Strip off Chr(13)+Chr(10) at end of string
End Sub
I haven't really tested this code so I hope I typed it right. Anyway, it should give you a good head start.
Ryan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|