Ask a Question related to PERL Beginners, Design and Development.
-
Paul Harwood #1
SMTP From field using MIME::Lite
I wrote the following code:
MIME::Lite->send('smtp', "mail.myserver.com", Timeout=>60);
$msg = MIME::Lite->new(
From =>"administrator\@myserver.com",
To =>'user@company.org',
Subject =>"TEST",
Data =>"TEST",
);
$msg->send;
I want to have a display name present in the "From" field. In other
words, I would like the 'From' field to read:
Reporting Agent <administrator@myserver.com>
I can't seem to do this no matter what I try. Can I do this with
MIME::Lite?
--Paul
Paul Harwood Guest
-
How to log the output of Mime::Lite ?
I have this simple Mime::Lite script quoted below. It works alright. But I would like to trace the result of the output. Something like set -x in... -
MIME::Lite 3.01 in CGI script doing nothing
comp.lang.perl.modules: I am running: <CVSENV>root@d3020g:~/d3020g# perl -v This is perl, v5.6.1 built for i386-linux ... ... -
Questions about Net::SMTP and MIME::Lite
Hi, In my perl-script I'm using MIME::Lite and Net::SMTP. The modules I use within my perl-script are located in a sub-directory called... -
MIME::LITE question
I would like to have a display name present in the FROM field of messages I send. Example: Reporting Agent < reportingagent@company.com > All... -
How to Add Username/Password for SMTP Authentication in MIME::Lite?
Is it possible to use MIME::Lite using a SMTP server that needs authentication? My provider now demands authentification when sending mail via... -
Paul Kraus #2
RE: SMTP From field using MIME::Lite
> I wrote the following code:
Your code is correct. I would write the from as>
> MIME::Lite->send('smtp', "mail.myserver.com", Timeout=>60);
>
> $msg = MIME::Lite->new(
> From =>"administrator\@myserver.com",
> To =>'user@company.org',
>
> Subject =>"TEST",
> Data =>"TEST",
>
> );
>
> $msg->send;
>
>
> I want to have a display name present in the "From" field. In
> other words, I would like the 'From' field to read:
'administrator@myserver.com' to avoid esaping the @.
What do you get back when this is sent? This is a text only message
correct?
Here are some examples from the docs...
Create a simple message containing just text
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, [email]some@more.com[/email]',
Subject =>'Helloooooo, nurse!',
Data =>"How's it goin', eh?"
);
Create a simple message containing just an image
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, [email]some@more.com[/email]',
Subject =>'Helloooooo, nurse!',
Type =>'image/gif',
Encoding =>'base64',
Path =>'hellonurse.gif'
);
Create a multipart message
### Create the multipart "container":
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, [email]some@more.com[/email]',
Subject =>'A message with 2 parts...',
Type =>'multipart/mixed'
);
### Add the text message part:
### (Note that "attach" has same arguments as "new"):
$msg->attach(Type =>'TEXT',
Data =>"Here's the GIF file you wanted"
);
### Add the image part:
$msg->attach(Type =>'image/gif',
Path =>'aaa000123.gif',
Filename =>'logo.gif',
Disposition => 'attachment'
);
Paul Kraus Guest
-
Paul Harwood #3
RE: SMTP From field using MIME::Lite
I want to be able to add a display name as well. For example: Paul
Harwood instead of the SMTP address.
Your code is correct. I would write the from as> I wrote the following code:
>
> MIME::Lite->send('smtp', "mail.myserver.com", Timeout=>60);
>
> $msg = MIME::Lite->new(
> From =>"administrator\@myserver.com",
> To =>'user@company.org',
>
> Subject =>"TEST",
> Data =>"TEST",
>
> );
>
> $msg->send;
>
>
> I want to have a display name present in the "From" field. In
> other words, I would like the 'From' field to read:
'administrator@myserver.com' to avoid esaping the @.
What do you get back when this is sent? This is a text only message
correct?
Here are some examples from the docs...
Create a simple message containing just text
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, [email]some@more.com[/email]',
Subject =>'Helloooooo, nurse!',
Data =>"How's it goin', eh?"
);
Create a simple message containing just an image
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, [email]some@more.com[/email]',
Subject =>'Helloooooo, nurse!',
Type =>'image/gif',
Encoding =>'base64',
Path =>'hellonurse.gif'
);
Create a multipart message
### Create the multipart "container":
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, [email]some@more.com[/email]',
Subject =>'A message with 2 parts...',
Type =>'multipart/mixed'
);
### Add the text message part:
### (Note that "attach" has same arguments as "new"):
$msg->attach(Type =>'TEXT',
Data =>"Here's the GIF file you wanted"
);
### Add the image part:
$msg->attach(Type =>'image/gif',
Path =>'aaa000123.gif',
Filename =>'logo.gif',
Disposition => 'attachment'
);
Paul Harwood Guest
-
Paul Kraus #4
Re: SMTP From field using MIME::Lite
This code works for me
-----
#!/usr/bin/perl
use strict;
use warnings;
use MIME::Lite;
my $msg = MIME::Lite->new(
From => '"Paul Kraus" [email]pkraus@pelsupply.com[/email]',
To => 'pkraus@pelsupply.com',
Subject => 'RE:SMTP From field using MIME::Lite - Test Send',
Data => 'This message sent with mime lite'
);
MIME::Lite -> send ('smtp','my.mailserver.com' );
$msg -> send;
Paul Kraus Guest
-
Paul Harwood #5
RE: SMTP From field using MIME::Lite
It might be my mail server settings. I am using Exchange Server 2003.
SMTP MAIL command failed:
5.5.4 Invalid Address
I will check into this more.
-----Original Message-----
From: Paul Kraus [mailto:pkraus@pelsupply.com]
Sent: Tuesday, December 09, 2003 4:21 PM
To: Paul Harwood; Beginner Perl
Subject: Re: SMTP From field using MIME::Lite
This code works for me
-----
#!/usr/bin/perl
use strict;
use warnings;
use MIME::Lite;
my $msg = MIME::Lite->new(
From => '"Paul Kraus" [email]pkraus@pelsupply.com[/email]',
To => 'pkraus@pelsupply.com',
Subject => 'RE:SMTP From field using
MIME::Lite - Test Send',
Data => 'This message sent with mime lite'
);
MIME::Lite -> send ('smtp','my.mailserver.com' );
$msg -> send;
Paul Harwood Guest
-
Unregistered #6
Re: SMTP From field using MIME::Lite
i would like someone to help me with SMTP please i will be glad thanks and here is my Email address :: john.hampton11@ymail.com
Unregistered Guest



Reply With Quote

