Sign in to follow this  

sending email through program

This topic is 3632 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 -0700
HELO Someone or other
250 mc9-f15.hotmail.com Hello [82.41.45.74]
MAIL FROM: YourSourceAddres@YourDomain.com
250 YourSourceAddres@YourDomain.com....Sender OK
RCPT TO: someonehotmail.com
250 someonehotmail.com
DATA
354 Please start mail input.
I like pie.
Yum.
But not floorpei
.
250 Mail queued for delivery.
QUIT
221 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.

Share this post


Link to post
Share on other sites
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


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
To the OP: While these forums are a great way to help you overcome difficulties you have with programming, they also require you to do some yourself.

In all your posts, I basically see "I want to send an e-mail through a self-written program, now show me C++ code on how to do it." in every post.

If you give you hints, doing the research might take a few hours, and perhaps trying to implement some things yourself. Google for "C++ SMTP Library" and you have plenty of SMTP libraries.

We're not going to do your work for you, you'll have to do it yourself. We can aid you, provide hints and pointers to useful material, but in the end, you have to implement and understand it yourself. Therefor, you need to read.

Toolmaker

Share this post


Link to post
Share on other sites
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


Sure, for $1495 I'll do that.

Or did you mean to post this in Help Wanted section?

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
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


Sure, for $1495 I'll do that.

Or did you mean to post this in Help Wanted section?



now why do u want $1495 for just helping .
if cant do it in free, then i done need your help Antheus

Share this post


Link to post
Share on other sites
Quote:
Original post by asdfwe
Quote:
Original post by Antheus
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


Sure, for $1495 I'll do that.

Or did you mean to post this in Help Wanted section?



now why do u want $1495 for just helping .
if cant do it in free, then i done need your help Antheus


1) He was being sarcastic, saying that if you want someone to write it for you then you will have to pay for it.

2.) What you need to do is find documentation on network programming (check the faq linked above) after you learn how to open a network connection you need to set it to open on the smtp port which is port 25 at the address of the mail server smtp.gmail.com i think is what it is.

Once you can open a connection to the server you need to know how to form the commands that you need to send. In this case all you can do is google "c++" smtp and see if you come up with anything use full.

The other way around this is to use a library that someone else has already taken the time to write. This will save you the time in learning it yourself but takes away from the experience that you will gain from doing it yourself.

~Feral

Share this post


Link to post
Share on other sites

This topic is 3632 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this