Sending emails.
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?
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.
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.
Google for 'Simple Mail Transfer Protocol', aka, SMTP.
Feel free to telnet to a SMTP server and play around.
Feel free to telnet to a SMTP server and play around.
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)
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)
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.
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.
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement