- #Mac os x shell script send email using perl via gmail how to#
- #Mac os x shell script send email using perl via gmail mac os x#
- #Mac os x shell script send email using perl via gmail install#
The server will respond with: 221 2.0.0 Bye. If you want to send out another message, repeat steps 4-6, otherwise, type in quit. This is a test! When you are done typing in the message body, hit the enter key, then type in a "."ħ. Type in the message you want included in the body. The server will then notify you that it is now OK to provide the data.Ħ. The next step is to tell the server data is coming for the body of the message. If there is some problem with the recipient-address, your mail will bounce.ĥ. rcpt to: You can enter any e-mail address. Provide the server who you want to send the e-mail to. Depending on your mail server's security settings, the mail from may be required to be from a certain domain suffix.Ĥ.
If the server accepts your input, you should expect the following in returnģ. If your computer name is, then type in the following: helo. This will open a TELNET window, and you should expect a response such asĢ. Open a command prompt and connect to the SMTP server using TELNETover port 25. Use Telnet to test SMTP communication on Exchange servers 1.
#Mac os x shell script send email using perl via gmail how to#
Here is an example of how to use the command: % mail_files -t -s subject -b attachedFileNameEnter your message texthere in as many lines as necessarywith control-D at the end.Edit the script for a detailed description of all the options in the comments.SMTP Commands: How to Send Email Using Telnet … Enter the mail_files command with no arguments for a short description of the options. If you just installed the script into a directory in your path, be sure to enter the rehash command to make sure that your shell knows it is there. You can delete the MIME-Base64-3.00 directory if you like.
#Mac os x shell script send email using perl via gmail install#
#Mac os x shell script send email using perl via gmail mac os x#
Installing the MIME::Base64 package on Mac OS X 10.2.x Make the file executable by entering: % chmod u=rwx,go=rx mail_filesIf you are using Mac OS X 10.3, you are done! Skip the rest of the steps, and see the example at the end.Save it to a directory in your path with an appropriate name (i.e., mail_files).The one modification I made to the script is to change the /usr/bin/sendmail command to /usr/sbin/sendmail, the correct path on Mac OS X. This package comes with Mac OS X 10.3 (10.2.x users must install it, though). The script also requires perl with the MIME::Base64 package installed. The shell script requires that your Mac be configured as a mail server that can send mail using the sendmail command (Mac OS X 10.3 uses postfix, but it still has a sendmail command for compatibility purposes). My modified Mac OS X version is also available for download. (10.2 users must also install a perl package.) The original script is by Dave Wotton. Thanks to Google, I found a shell script to do just that, and it only requires one modification (detailed below) to work on Mac OS X 10.3. From time to time I need to send an E-mail with MIME attachments from the command line while logged on via an SSH connection.