jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Sending mail with this script, I receive email from mygmail@gmail.com not from me@mydomain.com. Can this be changed ?#!/usr/bin/perl -w use warnings; use strict; use Net::SMTP::TLS; my $EMAIL_SMTP='smtp.gmail.com'; my $EMAIL_HELLO='me@mydomain.com'; # ????? my $EMAIL_PORT=587; my $EMAIL_SENDER = 'mygmail@gmail.com'; my $EMAIL_PASSWORD='s3cr3t'; my $mailer = new Net::SMTP::TLS ( $EMAIL_SMTP, Hello => $EMAIL_HELLO, Port => $EMAIL_PORT, User => $EMAIL_SENDER, Password=> $EMAIL_PASSWORD, ); # this doesn't work #$mailer->datasend("From: me\@mydomain.com"); #$mailer->datasend("To: you\@yourdomain.com"); #$mailer->datasend("Subject: This is a test"); #$mailer->datasend("\n"); #$mailer->datasend("blahblah\n"); $mailer->mail('me@mydomain.com'); $mailer->to(you@yourdomain.com'); $mailer->data; $mailer->datasend("Sent thru TLS!"); $mailer->dataend; $mailer->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: howto set the 'from' address (Net::SMTP::TLS)?
by cormanaz (Deacon) on Jun 25, 2009 at 21:51 UTC | |
by jeanluca (Deacon) on Jun 26, 2009 at 07:19 UTC | |
|
Re: howto set the 'from' address (Net::SMTP::TLS)?
by Anonymous Monk on Jun 26, 2009 at 03:09 UTC |