Skip to content

Instantly share code, notes, and snippets.

@eMaringolo
Created May 30, 2014 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eMaringolo/b67de9fa3f7d2db31732 to your computer and use it in GitHub Desktop.
Save eMaringolo/b67de9fa3f7d2db31732 to your computer and use it in GitHub Desktop.
Simple example on how to send emails from Pharo using MandrillApp client
"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