If your machine is not running an email server then you can use any other email server available at the remote location. You can attach as many files as you like in your email using attach() method. If you want to send an attachment, then following script serves the purpose − $msg->attr("content-type" => "text/html") Following is the script, which will take care of sending HTML formatted email − If you want to send HTML formatted email using sendmail, then you simply need to add Content-type: text/html\n in the header part of the email. Now following is a script which will take care of sending email to the given email ID − Now you are ready to send your email with simple scripts explained below. That's it and you will have MIME::Lite module installed on your machine. You can download this module from MIME-Lite-3.01.tar.gz and install it on your either machine Windows or Linux/Unix. But you have alternate to write your own email client using MIME:Lite perl module. If you are working on windows machine, then you will not have access on sendmail utility. If you want to send HTML formatted email using sendmail, then you simply need to add Content-type: text/html\n in the header part of the email as follows − So you have to make sure email server is properly configured and running on your machine to send email to the given email ID. This script will not be responsible for sending email to actual destination. $message = 'This is test email sent by Perl Script' Īctually, the above script is a client email script, which will draft email and submit to the server running locally on your Linux/Unix machine. This may be different for your Linux/Unix machine. Just make sure the given path for sendmail utility is correct. Here is a sample script that can send an email to a given email ID. If you are working on Linux/Unix machine then you can simply use sendmail utility inside your Perl program to send email. Using sendmail Utility Sending a Plain Message
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |