hello 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.ic...@myprivatedomain.com <jitu.ic...@domain.com>' msg['Date'] = formatdate(localtime=True) msg['To'] = 'jitu.ic...@gmail.com' # 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 wanted:\nhttp://www.python.org" html = """\ <html> <head></head> <body> <p>Hi!<br> How are you?<br> This mail is send by wjitenrda Here is the <a href="http://www.python.org">link</a> you wanted. </p> </body> </html> """ part2 = MIMEText(html, 'html') msg.attach(part2) # Send the message via local SMTP server. s = smtplib.SMTP('smtp.myprivatedomain.com <http://name.com>') s.login("user","password") s.sendmail(msg['From'], msg['To'], msg.as_string()) s.close() ''''''''''''''''''''''''''''''''''''''''''''''''''''''''' CODE END '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' using this code i am able to send the email , but problem is when i am changing msg['To'] = "wrongu...@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)
-- http://mail.python.org/mailman/listinfo/python-list