<<< 220 Example.ORG SMTP server here >>> EHLO Example.ORG <<< 250-Example.ORG <<< 250-DSN <<< 250-EXPN <<< 250 SIZE >>> MAIL FROM: RET=HDRS ENVID=QQ314159 <<< 250 sender ok >>> RCPT TO: NOTIFY=SUCCESS \ ORCPT=rfc822;Bob@Example.COM <<< 250 recipient ok >>> RCPT TO: NOTIFY=FAILURE \ ORCPT=rfc822;Carol@Ivory.EDU #### use Net::SMTP; my $smtp = Net::SMTP->new('mail.example.org'); $smtp->ehlo(); $smtp->mail(' RET=HDRS ENVID=QQ314159'); $smtp->to('RCPT TO: NOTIFY=SUCCESS ORCPT=rfc822;Bob@Example.COM '); $smtp->data(); $smtp->datasend('To: Alice@Example.ORG'); $smtp->datasend('Subject: test'); $smtp->data(); $smtp->datasend($your_message_here); $smtp->dataend(); $smtp->quit();