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
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)
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
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.