Created
May 30, 2014 03:57
-
-
Save eMaringolo/b67de9fa3f7d2db31732 to your computer and use it in GitHub Desktop.
Simple example on how to send emails from Pharo using MandrillApp client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Get client at http://smalltalkhub.com/#!/~NorbertHartl/Mandrill" | |
"Set the api key only once." | |
MandrillClient apiKey: 'yourApiKeyGoesHere'. | |
(MandrillMessage new | |
addRecipient: (MandrillRecipient new email: 'alice@there.com'); | |
fromName: 'Bob'; | |
fromEmail: 'bob@yourdomain.com'; | |
subject: 'Sending mails from Pharo'; | |
text: 'This is the plain text body'; | |
html: '<h1>But can have content in HTML!</h1>') send | |
"You can inspect the object returned to checked whether it succeeded or not." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment