email varification using smtplib or any method

jitendra gupta jitu.icfai at
Fri Feb 20 05:58:24 CET 2009

here is my code for sending the mail, using this code email is going
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''    CODE
import smtplib
from time import strftime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.Utils import COMMASPACE, formatdate

# Create message container - the correct MIME type is multipart/alternative.
msg = MIMEMultipart('alternative')
msg['Subject'] = " is sending the mail"
msg['From'] = 'jitu.icfai at <jitu.icfai at>'
msg['Date'] = formatdate(localtime=True)
msg['To'] = 'jitu.icfai at'

# Create the body of the message (a plain-text and an HTML version).
#text = "jitendra kya huy a!\nHow are you?\nHere is the link you
html = """\
       How are you?<br>
       This mail is send by wjitenrda
       Here is the <a href="">link</a> you wanted.

part2 = MIMEText(html, 'html')


# Send the message via local SMTP server.
s = smtplib.SMTP(' <>')
s.sendmail(msg['From'], msg['To'], msg.as_string())
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''    CODE  END
using this code i am able to send the email , but problem is
when i am changing
msg['To'] = "wronguser at wrongdomain.comddsdjsdsdsjdh"
some wrong email then i am getting back failure notice in my inbox, which i
dont want..
is there any way so that i can identify wrong email during the run time
(when i am sending  the email)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list