-
May 2nd, 2005, 01:28 PM
#1
Another E-Mail Question (SMTP)...
I'm trying out this very nice little app for sending email written by WizBang, thanks WizBang. I can't figure out how to add a Subject line to it without generating an error. Any help would be appreciated. here is the section I'm working wth:
Code:
Private Sub Winsock1_Connect()
Label1 = "Sending message..."
Winsock1.SendData "EHLO " & UserName & vbCrLf
If Not WaitFor("250") Then GoTo 100
Winsock1.SendData "MAIL FROM: " & UserMail & vbCrLf
If Not WaitFor("250") Then GoTo 100
Winsock1.SendData "RCPT TO: " & MailRecipiant & vbCrLf
If Not WaitFor("250") Then GoTo 100
Winsock1.SendData "DATA" & vbCrLf
If Not WaitFor("354") Then GoTo 100
Winsock1.SendData MailBody & vbCrLf & "." & vbCrLf
If Not WaitFor("250") Then GoTo 100
Winsock1.SendData "QUIT" & vbCrLf
If Not WaitFor("221") Then GoTo 100
Label1 = "Message sent"
GoTo 200
100
Label1 = SockData
200
Winsock1.Close
End Sub
Thanks
Rel
-
May 2nd, 2005, 02:27 PM
#2
Re: Another E-Mail Question (SMTP)...
The subject is part of the data contained in the body of the message.
Here are some common parts you should include, when applicable:
date
from
x-mailer
mime version
to
Subject
content type
content type message (defines the boundry for an attachment, and a few other things)
the message body itself (your text)
attachment (if any)
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
May 2nd, 2005, 03:55 PM
#3
Re: Another E-Mail Question (SMTP)...
How do I differentiate between the differente parts of the MailBody string. I mean how do I seperate the Subject from the Body if it is just one string?
Thanks
Rel
-
May 2nd, 2005, 04:19 PM
#4
Re: Another E-Mail Question (SMTP)...
Each part is seporated by a vbCrLf, and two vbCrLf codes before you insert the message text itself. Sorry I left out that bit of info. Perhaps I'll get to throw together an example one day, but you can find some on PlanetSourceCode.com.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
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
|