Jump to content
  • Advertisement
Sign in to follow this  
Thevenin

Sending emails.

This topic is 4772 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

I need my CGI application (Programmed in C) to send emails to the players. I'm familiar with winsock, and hoping I can just isolate the domain of the email address, connect to it, and send a single TCP packet without having to parse though protocal headers and such. Problem is, I don't know what to include in that TCP packet, or wheter a single TCP packet will do. Anyone mind explaining to me what I need to do, or a link to a tutorial?

Share this post


Link to post
Share on other sites
Advertisement
You'll need to use SMTP, it's pretty simple.

Send something like this:

HELO smtp.wanadoo.co.uk
MAIL FROM:omgwtf@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com
RCPT TO:bbq@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com
DATA
blah blah this isn't s.p.a.m by the way :)
PS Viagra click here ;P
.

The server will send you responses. If they start with a 2, everything is OK, if they start with a 5, something is wrong, try reading the message.
The dot on its own is important as it signifies the end of the message.

In other words, You don't need to connect to the domain of the e-mail address, you need a fixed SMTP server, which could even be localhost if you are running an smtp server.

Share this post


Link to post
Share on other sites
SMTP looks straight forward: easier than I was expecting anyways. [smile]

How do I interface between a SMTP server and a C application?

I see they are using Telnet, but I want to use Winsock =(

(Partly because I don't know how to call Telnet from a C application)

Share this post


Link to post
Share on other sites
You can use Winsock.

Using telnet, you connect to the SMTP server and you play the part of the email client. You write the commands you want to send to the server, and you can see the servers responses. Great for learning or debugging.

Share this post


Link to post
Share on other sites
Quote:
Original post by smart_idiot
You can use Winsock.

Using telnet, you connect to the SMTP server and play the part of an email client. You write the commands you want to send to the server, and you can see the servers response.


I can use Winsock? Good! [smile]

Yes, telnet looks quite fun to play around with
Image Hosted by ImageShack.us

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!