我正在尝试使用Mailgun通过SMTP发送电子邮件。该电子邮件具有application / ld + json标记EventReservation
。如果我使用mailgun smtp发送电子邮件,则标记不起作用,如果我通过google.scripts发送相同的模板,则标记工作正常。
有什么问题?
这是我的模板:
<!DOCTYPE html>
<html>
<head>
<title>Prenotazine TiPrenota</title>
<meta charset="UTF-8">
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EventReservation",
"reservationNumber": "5aa46b79-140d-491e-a1db-568ec1c423bd",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"@type": "Person",
"name": "Mario Rossi
},
"reservationFor": {
"@type": "Event",
"name": "Ragione sociale attivita",
"startDate": "2017-03-27T12:30:00",
"location": {
"@type": "Place",
"name": "nome ragione sociale",
"address": {
"@type": "PostalAddress",
"streetAddress": "viale amore 100, cesena, 47521, Italia"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": "44,490501",
"longitude": "12,281881"
}
},
"performer":"Reservation"
},
"modifyReservationUrl": "https://www.domionio.it/?tokenid=5aa46b79-140d-491e-a1db-568ec1c423bd"
}
</script>
</head>
<body>
Testo emeil
</body>
</html>
答案 0 :(得分:0)
确保您已按照此steps了解如何使用SMTP发送电子邮件。
运行:
# Swaks is an smtp of CURL, install it first:
curl http://www.jetmore.org/john/code/swaks/files/swaks-20130209.0/swaks -o swaks
# Set the permissions for the script so you can run it
chmod +x swaks
# It's based on perl, so install perl
sudo apt-get -y install perl
# now send!
./swaks --auth \
--server smtp.mailgun.org \
--au postmaster@YOUR_DOMAIN_NAME \
--ap 3kh9umujora5 \
--to bar@example.com \
--h-Subject: "Hello" \
--body 'Testing some Mailgun awesomness!'
您可以在domains tab上找到每个域的SMTP凭据。