About mail and sendmail
I don't know much about mail , but a quick Google search seems to indicate that it uses a postfix, which is the default SMTP server installed on Mac computers. In other words, you have installed and are using the SMTP server on your Macbook Pro.
About Ruby
So, can I send email from Ruby without an SMTP server?
Yes and no. You do not need the SMTP server to run on the same computer as your Ruby process. In fact, you don’t even have to start your own SMTP server. However, you need an SMTP server to send your email.
About SMTP
This article on howstuffworks provides a good explanation of what SMTP does. Basically, you need an SMTP server somewhere that accepts your email, talks to other SMTP servers and sends your email for delivery. With Ruby, you can configure Net :: SMTP to connect to the SMTP server of your choice.
About what you are trying to do
If you want to write and execute a script that will provide a small number of email messages, create a fake email account in Gmail / Live and use your SMTP servers to send email.
If you want to create and run an application that will deliver emails to your users, use Mandrill , MailGun or SendGrid. Mandrill has a free level for you to get started.
I do not recommend starting your own SMTP server for most use cases, because your emails will most likely be marked as spam. (Comcast might also think that you have malware on your network.) Professional services such as Mandrill can help you configure SPF and DKIM records to authenticate your emails and improve your sending reputation.
(If you just want to check email in dev mode, use MailCatcher .)
Conclusion
Subscribe to Mandrill , then use Net :: SMTP in Ruby to connect to your SMTP servers. No additional software required.
James lim
source share