[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Modules] Module Newbie: Mail subject?



On Mon, Jul 26, 1999 at 03:01:27PM +0000, Campbell-Lange wrote:
} Hi
} I don't seem to be able to add a 'subject' field. 
} Also the 'From' doesn't have anything in my mail client, only
} Return-Path: <workshop@tesco.net> is specified in the header. 
} Any ideas?

Net::SMTP, unsuprisingly, implements the SMTP protocol.  SMTP knows
nothing about "From:", "Subject:", or any other of the lines you think
of as the mail header.  All of those you should put in your data.  Any
line from the beginning of the data to the first blank line is
considered "mail header".  So your "body of text message" should look
something like

From: your address
Subject: whatever
X-message: spammers die die die!

This is the body of the message

This will be displayed properly by unbroken mail clients.  (Send
yourself a test message to show yourself that it works.)

The alternative is to use MailTools, which will deal with a lot of the
headers for you and then pass everything on to Net::SMTP.

}     
}     #!perl -w
}     
}     use Net::SMTP;
}     #### Host
}     $smtp = Net::SMTP->new('mail.easynet.co.uk');
}         
}     ### From, but only "Return-Path: <workshop@tesco.net>"
}     $smtp->mail('workshop@tesco.net');  
}     
}     ### I'd like to add normal 'From' here
}     
}     ### Target email address            
}     $smtp->to('campbell-lange@easynet.co.uk');
}         
}     ### I'd like to add 'Subject' here
}         
}     ### Body     
}     $smtp->data(q!body of text message!);
}     
}     ### Send it (do I need text in the method?)
}     $smtp->datasend("to rory\n");
}         
}     ### Quit
}     $smtp->quit;
}     
} Thanks for any help.
} Rory
} --
} Rory Campbell-Lange     			            Campbell-Lange Workshop
} --
} 
} 
} 
} ==== Want to unsubscribe from this list?
} ==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org
} 

-- 
Paul Schinder
schinder@pobox.com

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org