sending email through program

Started by
12 comments, last by Feralrath 16 years, 3 months ago
how can we send an email through a code in c++ thanks in advance
Advertisement
managed or unmanaged c++?
" managed or unmanaged c++? "


what do u mean by that ?????????

What OS? What mail server? What exactly are you trying to do? If you have an SMTP server address, you can connect to it and send SMTP commands to send an E-mail. Is this to only run on one PC (E.g. a server of some sort), or is it to run on any PC?

os: windows xp
i wanna send an email to myself at gmail.com
through a program in c++

what is SMTP ?????????

thanks
Quote:Original post by asdfwe

os: windows xp
i wanna send an email to myself at gmail.com
through a program in c++

what is SMTP ?????????

thanks
SMTP.

There's vaious libraries about that you can probably use, or you could do it yourself by opening a network connection to your SMTP server and sending the mail that way. If I were you, I'd google for "C++ SMTP library" or something.
ok
i read about SMTP but cant understand much

is there some simpler way to send email through codes in c++

Quote:Original post by asdfwe
ok
i read about SMTP but cant understand much

is there some simpler way to send email through codes in c++
Yes, by getting a library that someone's already written. Sending E-mail a case of connecting to the correct mail server (For simplicities sake, it's much easier to connect to your ISPs mail server and use that to relay the E-mail), and communicating with the server to send the e-mail.

An example transation might go like so (Any line beginning with a number is sent by the server):
220 mc9-f15.hotmail.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.6824 ready at Sun, 18 Apr 2004 06:34:34 -0700HELO Someone or other250 mc9-f15.hotmail.com Hello [82.41.45.74]MAIL FROM: YourSourceAddres@YourDomain.com250 YourSourceAddres@YourDomain.com....Sender OKRCPT TO: someonehotmail.com250 someonehotmail.comDATA354 Please start mail input.I like pie.Yum.But not floorpei.250 Mail queued for delivery.QUIT221 Closing connection. Good bye.

Sending mail is a lot more complicated than just calling a function (Unless youre using another library to do it for you), since it involves betworking.
it will be a great help if u could provide me with details of procedure of how to
begin writing a code in c++ that could send e mails to someone@gmail.com


Quote:Original post by asdfwe
it will be a great help if u could provide me with details of procedure of how to
begin writing a code in c++ that could send e mails to someone@gmail.com
So long as it's just gmail, you just need to connect to smtp.gmail.com on port 25, and start sending SMTP commands. I'd check out the Multiplayer and Network Programming Forum FAQ for links to various network libraries.

However, as I said, googling for an SMTP library may be quicker and easier.

This topic is closed to new replies.

Advertisement