1

I am sending a mail using the following code in Perl

#!/usr/bin/perl
$to = 'abcd@gmail.com';
$from = 'webmaster@yourdomain.com'; 
$subject = 'Test Email'; 
$message = 'This is test email sent by Perl Script'; 
open(MAIL, "|/usr/sbin/sendmail -t"); 
# Email Header 
print MAIL "To: $to\n"; 
print MAIL "From: $from\n"; 
print MAIL "Subject: $subject\n\n"; 

# Email Body 
print MAIL $message; 
close(MAIL); 
print "Email Sent Successfully\n";

Now how do i get the name of the sender while i am seeing the name. For eg. when i keep $from as abcd@xyz.com it displays name as abc while i want to give it my name like James Lawson.?

user227668
  • 41
  • 2
  • 8

0 Answers0