Ruby
Python
JavaScript

Search for '{{search_term}}'

Exercise: Send plain text e-mail

CMOS is the Code-Maven Open Source podcast that also includes video interviews. Subscribe to this feed RSS feed with your Podcast listener app or via iTunes iTunes.

Exercise: Send plain text e-mail.

Create a function that will get one or more addresses where To send the message, 0 or more address to Cc the message. A single addres to pretend as the From field.

Get a string to be the Subject line and some plain text to be the body of the e-mail.

By default this should assume to be running on a Linux/Unix system with a properly configured sendmail program and use that as the underlying transporting system.

Then also add an optional parameter SMTP that holds the name or IP address of an SMTP server. When this parameter is given, use the SMTP server to send the e-mail.

Comments

In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus