Python Script to send email

</div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">import smtplib</span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;"><br /></span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">def send_email(sender, receiver, subject, body):</span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">    msg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s" </span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">        %(sender, receiver, subject, body))</span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">    s = smtplib.SMTP('localhost')</span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">    s.sendmail(sender, [receiver], msg)</span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">    s.quit()</span></div><div><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;">

send_email(“yoyo@wize.com”, “utsav.sabharwal@nextag.com”, “checking check”, “yo yo alll good.. i am not feeling good”)    
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: