Emailing program

Questions about programming languages and debugging
Post Reply
User avatar
F4LSE
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 236
Joined: 02 Jul 2007, 16:00
16
Location: My Lab
Contact:

Emailing program

Post by F4LSE »

hey all, im looking to code a program that i can use my own smtp server to send mail to others. Also if at all possible i want to make it so that u can send anonymously. Ive looked around for sending mail with C++ but cant seem to grasp it so i thought i check the suck-o members and see what they suggested.
thanks in advance for any helps :P

/

User avatar
maboroshi
Dr. Mab
Dr. Mab
Posts: 1624
Joined: 28 Aug 2005, 16:00
18

Python

Post by maboroshi »

Quick look on google I came across this for python

Code: Select all

import smtplib

def mail(serverURL=None, sender='', to='', subject='', text=''):
    """
    Usage:
    mail('somemailserver.com', 'me@example.com', 'someone@example.com', 'test', 'This is a test')
    """
    headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (sender, to, subject)
    message = headers + text
    mailServer = smtplib.SMTP(serverURL)
    mailServer.sendmail(sender, to, message)
    mailServer.quit()
reference

Code: Select all

http://www.eskimo.com/~jet/python/examples/mail/smtp1.html

And theres lots of references to C++ Sending email on google... Do your homework

User avatar
F4LSE
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 236
Joined: 02 Jul 2007, 16:00
16
Location: My Lab
Contact:

Re: Python

Post by F4LSE »

Maboroshi wrote:Quick look on google I came across this for python

Code: Select all

import smtplib

def mail(serverURL=None, sender='', to='', subject='', text=''):
    """
    Usage:
    mail('somemailserver.com', 'me@example.com', 'someone@example.com', 'test', 'This is a test')
    """
    headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (sender, to, subject)
    message = headers + text
    mailServer = smtplib.SMTP(serverURL)
    mailServer.sendmail(sender, to, message)
    mailServer.quit()
reference

Code: Select all

http://www.eskimo.com/~jet/python/examples/mail/smtp1.html

And theres lots of references to C++ Sending email on google... Do your homework
lol aright well i suppose ill give another whirl and see what i can come up with. thanks :D

Post Reply