コード例 #1
0
ファイル: getalias.py プロジェクト: bengheng/SEAL
You requested for an alias. You can distribute any of the following SEAL aliases to your contacts.<br><br>

<ol>
<li>$aliasname&#46;$randstr@$srvfqdn</li>
<li>$aliasname&#95;$randstr@$srvfqdn</li>
<li>$aliasname&#45;$randstr@$srvfqdn</li>
</ol>
<br>
Email sent to these aliases will be relayed to your inbox. Note that the only difference amongst them is the separator used, which could be a period '.', an underscore '_', or a dash '-'.

</body>
</html>

"""

srvfqdn = socket.getfqdn()

mailfrom = '\"Alias Creation Service\" <getalias@'+srvfqdn+'>'
subject = Template(subjtmpl).safe_substitute({'aliasname':aliasname,
	'randstr':randstr,
	'srvfqdn':srvfqdn})
msgtxt = Template(textversion).safe_substitute({'aliasname':aliasname,
	'randstr':randstr,
	'srvfqdn':srvfqdn})
msghtml = Template(htmlversion).safe_substitute({'aliasname':aliasname,
	'randstr':randstr,
	'srvfqdn':srvfqdn})

sendmail.sendmail_htmlmultipart(mailfrom, [fwdaddx], subject, msgtxt, msghtml)
コード例 #2
0
ファイル: verimail.py プロジェクト: bengheng/SEAL
vcode = sys.argv[2]

subject = "SEAL Verification"

textversion = """

Please paste the link below into the URL bar of your browser to continue creating your SEAL account.

$linkola

"""

htmlversion = """

<html>
<body>
Please follow <a href="$linkola">this link</a> to continue creating your SEAL account.
</body>
</html>

"""

srvfqdn = socket.getfqdn()
mailfrom = "noreply@" + srvfqdn
rcpttos = ["{name}@umich.edu".format(name=uniqname)]

link = "https://" + srvfqdn + "/adduser.php?mailverify={veri}".format(veri=vcode)
msgtxt = Template(textversion).safe_substitute({"linkola": link})
msghtml = Template(htmlversion).safe_substitute({"linkola": link})
sendmail.sendmail_htmlmultipart(mailfrom, rcpttos, subject, msgtxt, msghtml)