Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending attachments with winsock

Status
Not open for further replies.

poeijer

Programmer
May 29, 2002
69
0
0
NL
hi,

i can send mails with smtp but my question is how do i attach attachments to the messages?

oWinsock = CREATEOBJECT("MSWinsock.Winsock.1")
oWinsock.Protocol = 0
oWinsock.RemoteHost = mailserver
oWinsock.RemotePort = 25
oWinsock.Connect

IF oWinsock.State = sckConnected
WAIT CLEAR
oWinsock.senddata("Helo myself.com" + crlf)
oWinSock.senddata("Mail From:"+lcFrom + crlf)
=inkey(.25)
oWinSock.senddata("RCPT TO:" + lcTo + crlf)
=Inkey(.25)
oWinsock.senddata("DATA" + crlf)
oWinsock.senddata("From:" + lcFrom + crlf)
oWinSock.senddata("To:"+ lcTo + crlf)
oWinsock.senddata("Subject:" + lcSubject + crlf)
oWinsock.senddata(crlf + lcBody + crlf)
=Inkey(.25)

** add attachments??? **

oWinsock.senddata("." + crlf)
=Inkey(.25)
oWinsock.senddata("quit")

so what to do to add an attachment "c:\test.txt" to this mail??

thanks in advance



 
I just went to the link you provided wgcs... nice job on the translation of the encoding for attachments stuff. Slighthaze = NULL
 
Thanks!

Most of the translation can be automated, (though I didn't use a tool for this translation):
I just now gathered together all the tranformations I could remember offhand into a conversion function that some may find useful. See thread184-503826
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top