开发者

sending mail with attachment in c++? (or How do I construct a MIME encoded email message that I can send to SMTP?) [duplicate]

This question already has answers here: 开发者_开发技巧 How do I send attachments using SMTP? (6 answers) Closed 3 years ago.

is it possible to do it without any third-party lib.

i can send mail to gmail with a simple socket functions. i can send files one computer to another too. But i need to send with attachment to any mail account...

can it be done with smtp?

(i searched in here but the answers, that i looked, are not in c++ or not on windows or not open source completely. Sorry if there is/are answer(s) that given before, but i couldn't find )

thanks,


Absolutely yes.

As far as SMTP is concerned, you just provide it with the appropriate headers (the rfc822 is out of date, but is a good start) and then the message body, which can be anything.

You probably want to create a message body that is a MIME encoded message describing the text of the email and any attachments.

The question you should be asking is:

How do I construct a MIME encoded email message that I can send to SMTP?

Also, the problem of creating email messages and sending them has been solved so many times, you should really consider using a library if you're at all able to.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜