Ich versuche, eine Mail mit von cgi-Webkonsole mit E-Mail-Eingabefeld zu senden, aber es irgendwie unter Fehlern in Apache-Logsgesendete E-Mail von Python CGI - Fehler
Traceback (most recent call last):
File "/opt/apache-dba/cgi-bin/main.py", line 132, in <module>
mail()
File "/opt/apache-dba/cgi-bin/main.py", line 129, in mail
s.sendmail(me, you, msg.as_string())
File "/usr/lib64/python2.7/smtplib.py", line 742, in sendmail
raise SMTPRecipientsRefused(senderrs)
smtplib.SMTPRecipientsRefused: {'[email protected]/': (501, '5.1.3 Bad recipient address syntax')}
Aber ich bin in der Lage zu laufen der gleiche Code und in der Lage, die E-Mail von Python-Shell zu erhalten Unten ist der Code, das sieht aus wie wenn ich den Code von CGI ausführen es versucht, Mail von '[email protected]' zu '[email protected]/ zu konvertieren 'resultierender Syntaxfehler.
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
Emailid = [email protected]
Link='http://google.com'
def mail():
me = "[email protected]"
you = str(Emailid)
msg = MIMEMultipart('alternative')
msg['Subject'] = "Upgrade Status Link"
msg['From'] = me
msg['To'] = you
text = '%s' % str(Link)
part1 = MIMEText(text, 'plain')
msg.attach(part1)
s = smtplib.SMTP('localhost')
s.sendmail(me, you, msg.as_string())
s.quit()
mail()
jede Hilfe sehr geschätzt wird, Danke