How can I send an html email with perl?
- by alexBrand
I am trying to send an HTML email using perl.
open(MAIL,"|/usr/sbin/sendmail -t");
## Mail Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
## Mail Body
print MAIL "Content-Type: text/html; charset=ISO-8859-1\n\n<html><head></head><body>@emailBody";
close(MAIL)
Is that the correct way of doing it? It is not working for some reason. Thanks for your help.