SEND

2002-01-16 Thread Oktay Ahmed

Hi

Ý am a very beginner in Perl. Here is my problem:

I want to send some data on (via) established connection (telnet). I don't 
need any code to establish connection, to login, etc. I just need to send 
data (including "\n" at the end). How to do this?

What modules I have to use?

Sorry for asking this kind of simple questions...

Best,
Oktay

-
Oktay AHMED, MA, Chairman
MENSA MACEDONIA, The High-IQ Society
P.O.Box 747, 1000 Skopje, Macedonia
E-mail: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Web: 
Fax: +1 305 574 0549 (USA) /  +44 870 136 3517 (UK)
-



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Mail::Send

2002-09-20 Thread Tom Allison

I was trying to use the Mail::Send module for shipping out some 
email, but I'm getting nothing.

No errors, event with lots of die opportunities.
No logs registering an attempt.

Nothing.

help?
-- 
A mouse is an elephant built by the Japanese.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




send variable

2001-05-07 Thread nakosu-budi

i have problem with send variable to other page.
i have form and the form has variable will send to other
page.
but i can't do it.
anybody can help me?
thank you



send variable

2001-05-08 Thread nakosu-budi

i have try from john lee mail. but i got problem
the message syntax error at ./test.pl line 2, near "use
CGI."
Execution of ./test.pl aborted due to compilation errors.

this mainPage (include form and variable)

#!/usr/bin/perl -w

print "Content-type: text/html\n\n";

print "


New Page 1






  
  


--
this nextPage.pl
#!/usr/bin/perl -w
use CGI.pm

$rCGI = new CGI;
$id =  $rCGI->param('id');

print "Content-type: text/html\n\n";

print $id;
if ($id==1){
print "satu";
}else{
print "Bukan satu";
}


maybe there's mistake on my programs.
thank you




RE: SEND

2002-01-16 Thread Hanson, Robert

You can't send data through an open Telnet session if that is what you are
thinking. (disclaimer: maybe you can, but good luck trying to do that).
What you want is to use the Net::Telnet module.

use Net::Telnet;

# Open a telnet session
my $t = new Net::Telnet (Timeout => 10);
$t->open("1.2.3.4");

# Login
$t->login($username, $passwd);

# Execute the command 'ls' (or whatever you need) when you see the prompt '$
'
$t->cmd(String => 'ls', Prompt => '/\$ $/');

# Close the connection
$t->close;

Or are you just trying to upload data?  Anyway, check out the Net::Telnet
docs, it might do exactly what you need.

Rob


-Original Message-
From: Oktay Ahmed [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 17, 2002 12:48 AM
To: [EMAIL PROTECTED]
Subject: SEND


Hi

Ý am a very beginner in Perl. Here is my problem:

I want to send some data on (via) established connection (telnet). I don't 
need any code to establish connection, to login, etc. I just need to send 
data (including "\n" at the end). How to do this?

What modules I have to use?

Sorry for asking this kind of simple questions...

Best,
Oktay

-
Oktay AHMED, MA, Chairman
MENSA MACEDONIA, The High-IQ Society
P.O.Box 747, 1000 Skopje, Macedonia
E-mail: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Web: 
Fax: +1 305 574 0549 (USA) /  +44 870 136 3517 (UK)
-



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: SEND

2002-01-16 Thread Agustin Rivera

Is there a way with Net::Telnet that I can read data and send data
simultaneously?  Or how about capturing the data that comes in to a
variable?

Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com



- Original Message -
From: "Hanson, Robert" <[EMAIL PROTECTED]>
To: "'Oktay Ahmed'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 16, 2002 1:12 PM
Subject: RE: SEND


> You can't send data through an open Telnet session if that is what you are
> thinking. (disclaimer: maybe you can, but good luck trying to do that).
> What you want is to use the Net::Telnet module.
>
> use Net::Telnet;
>
> # Open a telnet session
> my $t = new Net::Telnet (Timeout => 10);
> $t->open("1.2.3.4");
>
> # Login
> $t->login($username, $passwd);
>
> # Execute the command 'ls' (or whatever you need) when you see the prompt
'$
> '
> $t->cmd(String => 'ls', Prompt => '/\$ $/');
>
> # Close the connection
> $t->close;
>
> Or are you just trying to upload data?  Anyway, check out the Net::Telnet
> docs, it might do exactly what you need.
>
> Rob
>
>
> -Original Message-
> From: Oktay Ahmed [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 12:48 AM
> To: [EMAIL PROTECTED]
> Subject: SEND
>
>
> Hi
>
> Ý am a very beginner in Perl. Here is my problem:
>
> I want to send some data on (via) established connection (telnet). I don't
> need any code to establish connection, to login, etc. I just need to send
> data (including "\n" at the end). How to do this?
>
> What modules I have to use?
>
> Sorry for asking this kind of simple questions...
>
> Best,
> Oktay
>
> -
> Oktay AHMED, MA, Chairman
> MENSA MACEDONIA, The High-IQ Society
> P.O.Box 747, 1000 Skopje, Macedonia
> E-mail: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Web: 
> Fax: +1 305 574 0549 (USA) /  +44 870 136 3517 (UK)
> -
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: SEND

2002-01-16 Thread Hanson, Robert

All the module allows you to do is open up a telnet session and interact
with it.  So yes, you can store the return value of a command into a
variable like this:

my $host = $t->cmd(String => 'hostname', Prompt => '/\$ $/')

I'm not sure what you mean by sending/read data at the sime time.  I am
thinking that you can't do that, at least not the way you want.  You could
always open up two telnet sessions if you needed to, but you would need to
have two seperate processes (fork) and then have the processes talk to one
another.

Rob


-Original Message-
From: Agustin Rivera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 4:15 PM
To: Hanson, Robert; 'Oktay Ahmed'; [EMAIL PROTECTED]
Subject: Re: SEND


Is there a way with Net::Telnet that I can read data and send data
simultaneously?  Or how about capturing the data that comes in to a
variable?

Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com



- Original Message -
From: "Hanson, Robert" <[EMAIL PROTECTED]>
To: "'Oktay Ahmed'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 16, 2002 1:12 PM
Subject: RE: SEND


> You can't send data through an open Telnet session if that is what you are
> thinking. (disclaimer: maybe you can, but good luck trying to do that).
> What you want is to use the Net::Telnet module.
>
> use Net::Telnet;
>
> # Open a telnet session
> my $t = new Net::Telnet (Timeout => 10);
> $t->open("1.2.3.4");
>
> # Login
> $t->login($username, $passwd);
>
> # Execute the command 'ls' (or whatever you need) when you see the prompt
'$
> '
> $t->cmd(String => 'ls', Prompt => '/\$ $/');
>
> # Close the connection
> $t->close;
>
> Or are you just trying to upload data?  Anyway, check out the Net::Telnet
> docs, it might do exactly what you need.
>
> Rob
>
>
> -Original Message-
> From: Oktay Ahmed [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 12:48 AM
> To: [EMAIL PROTECTED]
> Subject: SEND
>
>
> Hi
>
> Ý am a very beginner in Perl. Here is my problem:
>
> I want to send some data on (via) established connection (telnet). I don't
> need any code to establish connection, to login, etc. I just need to send
> data (including "\n" at the end). How to do this?
>
> What modules I have to use?
>
> Sorry for asking this kind of simple questions...
>
> Best,
> Oktay
>
> -
> Oktay AHMED, MA, Chairman
> MENSA MACEDONIA, The High-IQ Society
> P.O.Box 747, 1000 Skopje, Macedonia
> E-mail: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Web: 
> Fax: +1 305 574 0549 (USA) /  +44 870 136 3517 (UK)
> -
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: SEND

2002-01-16 Thread Agustin Rivera

Ok, thanks.  But now you've made me curious about fork..

You can make the two processes of a fork talk to each other?  How?  I've
tried setting a variable in the child and printing in the parent, but that
didn't work.

Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com



- Original Message -
From: "Hanson, Robert" <[EMAIL PROTECTED]>
To: "'Agustin Rivera'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 16, 2002 1:29 PM
Subject: RE: SEND


> All the module allows you to do is open up a telnet session and interact
> with it.  So yes, you can store the return value of a command into a
> variable like this:
>
> my $host = $t->cmd(String => 'hostname', Prompt => '/\$ $/')
>
> I'm not sure what you mean by sending/read data at the sime time.  I am
> thinking that you can't do that, at least not the way you want.  You could
> always open up two telnet sessions if you needed to, but you would need to
> have two seperate processes (fork) and then have the processes talk to one
> another.
>
> Rob
>
>
> -Original Message-
> From: Agustin Rivera [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 16, 2002 4:15 PM
> To: Hanson, Robert; 'Oktay Ahmed'; [EMAIL PROTECTED]
> Subject: Re: SEND
>
>
> Is there a way with Net::Telnet that I can read data and send data
> simultaneously?  Or how about capturing the data that comes in to a
> variable?
>
> Agustin Rivera
> Webmaster, Pollstar.com
> http://www.pollstar.com
>
>
>
> - Original Message -
> From: "Hanson, Robert" <[EMAIL PROTECTED]>
> To: "'Oktay Ahmed'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, January 16, 2002 1:12 PM
> Subject: RE: SEND
>
>
> > You can't send data through an open Telnet session if that is what you
are
> > thinking. (disclaimer: maybe you can, but good luck trying to do that).
> > What you want is to use the Net::Telnet module.
> >
> > use Net::Telnet;
> >
> > # Open a telnet session
> > my $t = new Net::Telnet (Timeout => 10);
> > $t->open("1.2.3.4");
> >
> > # Login
> > $t->login($username, $passwd);
> >
> > # Execute the command 'ls' (or whatever you need) when you see the
prompt
> '$
> > '
> > $t->cmd(String => 'ls', Prompt => '/\$ $/');
> >
> > # Close the connection
> > $t->close;
> >
> > Or are you just trying to upload data?  Anyway, check out the
Net::Telnet
> > docs, it might do exactly what you need.
> >
> > Rob
> >
> >
> > -Original Message-
> > From: Oktay Ahmed [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 17, 2002 12:48 AM
> > To: [EMAIL PROTECTED]
> > Subject: SEND
> >
> >
> > Hi
> >
> > Ý am a very beginner in Perl. Here is my problem:
> >
> > I want to send some data on (via) established connection (telnet). I
don't
> > need any code to establish connection, to login, etc. I just need to
send
> > data (including "\n" at the end). How to do this?
> >
> > What modules I have to use?
> >
> > Sorry for asking this kind of simple questions...
> >
> > Best,
> > Oktay
> >
> > -
> > Oktay AHMED, MA, Chairman
> > MENSA MACEDONIA, The High-IQ Society
> > P.O.Box 747, 1000 Skopje, Macedonia
> > E-mail: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> > Web: 
> > Fax: +1 305 574 0549 (USA) /  +44 870 136 3517 (UK)
> > -
> >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: SEND

2002-01-16 Thread Bob Showalter

> -Original Message-
> From: Agustin Rivera [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 16, 2002 4:27 PM
> To: Hanson, Robert; [EMAIL PROTECTED]
> Subject: Re: SEND
> 
> 
> Ok, thanks.  But now you've made me curious about fork..
> 
> You can make the two processes of a fork talk to each other?  
> How?  I've
> tried setting a variable in the child and printing in the 
> parent, but that
> didn't work.

Processes can't access one another's memory, so you need to
use some form of IPC (interprocess communication). Examples
are pipes, signals, shared memory, message queues, semaphores

These are discussed at length in perldoc perlipc.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: SEND

2002-01-21 Thread Russ Foster

As was pointed out before, it's probably difficult (if not impossible) to
have perl access an already open telnet session.

However, I have accomplished a similar task by using perl to copy to/from
the Windows clipboard (of course, this precludes that you're using Windows).

Here's the process (in English):
1) Open the telnet session manually
2) Highlight the screen and copy to the clipboard
4) Execute the perl script
5) Parse, process, copy the results back to the clipboard
   (make sure my screen is now un-selected)
6) Paste the results back to the screen


 
Russell J Foster
Subject, Wills, & Company
e. [EMAIL PROTECTED]
v. 630-572-0240


-Original Message-
From: Oktay Ahmed [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 16, 2002 11:48 PM
To: [EMAIL PROTECTED]
Subject: SEND

Hi

Ý am a very beginner in Perl. Here is my problem:

I want to send some data on (via) established connection (telnet). I don't 
need any code to establish connection, to login, etc. I just need to send 
data (including "\n" at the end). How to do this?

What modules I have to use?

Sorry for asking this kind of simple questions...

Best,
Oktay

-
Oktay AHMED, MA, Chairman
MENSA MACEDONIA, The High-IQ Society
P.O.Box 747, 1000 Skopje, Macedonia
E-mail: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Web: 
Fax: +1 305 574 0549 (USA) /  +44 870 136 3517 (UK)
-



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Send Mail Issue

2005-06-03 Thread Anish Kumar K
This is the program I am using for SENDMAIL. Surprisingly it is not dying.
I could see an error message in the browser as "The System cannot find the path 
specified". I donno from where the message is coming..

I removed the SENDMAIL part and then checked, now the error is not comingI 
am sure it is with the sendmail. Is it some thing to do with the sendmail.

Any other module which will accomplisj the task



#!/usr/local/bin/perl
use strict;
use warnings;
use CGI;

my $cgi=new CGI;
print $cgi->header();
my $name = &clean($cgi->param('name')); // THIS IS FROM THE html FILE
my $age = &clean($cgi->param('age'));   // THIS IS FROM THE html FILE

my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = "Reply-to: [EMAIL PROTECTED]";
my $subject  = "Subject: Confirmation of your submission";
my $content  = "Thanks for your submission.";
my $to   = "[EMAIL PROTECTED]";

unless ($to) {
  print $cgi->header;
  print "Please fill in your email and try again";
}

open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $name;
print SENDMAIL $description;
close(SENDMAIL);

print $cgi->header;
print "Confirmation of your submission will be emailed to you.";

sub clean
{
 # Clean up any leading and trailing whitespace
 # using regular expressions.
 my $s = shift @_;
 $s =~ s/^\s+//;
 $s =~ s/\s+$//;
 return $s;
}




Re: Mail::Send

2002-09-20 Thread david

Tom Allison wrote:

> I was trying to use the Mail::Send module for shipping out some
> email, but I'm getting nothing.
> 
> No errors, event with lots of die opportunities.
> No logs registering an attempt.
> 
> Nothing.
> 
> help?

any code? maybe you are using the module in a wrong way? maybe your mail 
server is down? a lot of guess but no answer unless you provide something 
for us to check.

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Mail::Send

2002-09-20 Thread Tom Allison

david wrote:
> Tom Allison wrote:
> 
> 
>>I was trying to use the Mail::Send module for shipping out some
>>email, but I'm getting nothing.
>>
>>No errors, event with lots of die opportunities.
>>No logs registering an attempt.
>>
>>Nothing.
>>
>>help?
> 
> 
> any code? maybe you are using the module in a wrong way? maybe your mail 
> server is down? a lot of guess but no answer unless you provide something 
> for us to check.
> 
> david
> 

I found some obscure notes work, but don't make sense

Mail::Send says that the method of creating an email body is:
$fh=$msg->open;
And being based on Mail::Mailer, it will query for Mailx, mail, 
Mail first for a mail processing application.
Failing that, it will move to sendmail...qmail and others.

Well, 'mail' exists, but it doesn't work with Mail::Send.

I have to use the command:

$fh = $msg->open("sendmail");

And use the postfix alias/compatability program called sendmail to 
get this to work.

It's working, but I wish I knew more about why?

-- 
All programmers are playwrights and all computers are lousy actors.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Send mail quesiton

2002-05-23 Thread Lance Prais

All,
   I am trying to  "use Mail::Sendmail" to send mail.  The problem is that
the sendmail is in the right folder.  The only thing that comes to mind is
that I am doing this on NT

The path for the sendmail.pm is   perl/lib/mail/sendmail.pm

I am getting the following error:

E:\sea621\siebsrvr\BIN>emailmgr.pl
Can't locate Mail/Sendmail.pm in @INC (@INC contains:
E:/sea621/siebsrvr/BIN/lib
 E:/sea621/siebsrvr/BIN/site/lib .) at E:\sea621\siebsrvr\BIN\emailmgr.pl
line 3
0.
BEGIN failed--compilation aborted at E:\sea621\siebsrvr\BIN\emailmgr.pl line
30.

Anyone have any ideas?

Thanks


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: send variable

2001-05-08 Thread Johan Groth

nakosu-budi wrote:
> 
> i have try from john lee mail. but i got problem
> the message syntax error at ./test.pl line 2, near "use
> CGI."

> #!/usr/bin/perl -w
> use CGI.pm

This row should end with a ';'.
thus

use CGI.pm;

/Johan

--
Johan Groth (xghjn) ! Tel. mobil: 0703 - 24 25 27
Cell Network!   Kontoret:  054 - 14 25 27
[EMAIL PROTECTED] ! Bofors: 0586 - 820 14
[EMAIL PROTECTED]




Re: send variable

2001-05-08 Thread Tony Cook

On Tue, 8 May 2001, nakosu-budi wrote:

> i have try from john lee mail. but i got problem
> the message syntax error at ./test.pl line 2, near "use
> CGI."
> Execution of ./test.pl aborted due to compilation errors.
> 
> --
> this nextPage.pl
> #!/usr/bin/perl -w
> use CGI.pm

This should be:

  use CGI;

-- 
Tony




send and recv

2002-01-30 Thread Butterfly

Fiddling about with sockets, having some problems with send and recv.
Connecting successfully to an SMTP server, the following lines have odd
results:

$len=200;
recv SOCK, $foo, $len, 0;
print $foo;
send SOCK, "MAIL From:[EMAIL PROTECTED]\n", 0;
recv SOCK, $foo, $len, 0;
print $foo;

SOCK is connected as per the example in the section on Sockets in the Camel.

The first print is working fine, the second is never reached.  If, however,
I lower the value of $len to something like 10 then it stampedes through
with nary a problem (except, of course, for the fact that it only receives
the first 10 chars of the mesg).  The send *seems* to be working, it's just
the 2nd recv that seems to be b0rking.  Can anyone shed any light on this?

-Madi

-- 
This dress exacerbates the genetic travesty that is my legacy.
   -Heather (from Romy and Michelle)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to send "Net Send" messages from a Linux Server

2004-05-24 Thread LRMK
I want to write a Perl script to send net send messages to the windows based
computers but my scripts are running on Linux computer.
So I can't use

$results = `NET SEND $IP_ADDR blah blah blah blah `;

how to do this on a linux computer

I think that I will have to connect to the receivers port 135 and send the
message manualy using perl sockets
but I dont know the low level format of the message

Can someone help me on this

If there is a module to do this that will be great.



Rakhitha Karunarathne
Web Master
www.Ad-Man.tk - Free Unlimited Banner Rotators





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: How to send "Net Send" messages from a Linux Server

2004-05-25 Thread Tarun Dua
Lrmk wrote:

> I want to write a Perl script to send net send messages to the windows
> based computers but my scripts are running on Linux computer.
You can use the smbclient command on linux.
echo "Message" | smbclient -M 
-Tarun

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




How can I send an HTML format email using send mail

2001-12-17 Thread jeff

Does anyone know how to send an HTML formatted email using sendmail.  I can
send plain text email OK.  If I format the message using HTML the message
shows the HTML tags.  I can't find any information regarding this on cpan.
Are there any other modules that have this capability?  Any help is greatly
appreciated.

Jeff


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Send mail using SSL

2010-01-11 Thread Thomas Yan
Hi,

I want to send mail using ssl with smtp server. Does Mail::Sender support
SSL? Or must I use Net::Smtp::SSL ?

Regards,
Thomas.


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Fine tuning gmail send

2012-09-26 Thread Samir Arishy
This code is working.

use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
 'smtp.gmail.com',
 Hello   =>  'smtp.gmail.com',
 Port=>  587,
 User=>  'amyID',
 Password=>  'myPW');

$a="data from some calculation inside the script.";

$mailer->mail('x...@y.com');
$mailer->to('a...@b.com');
$mailer->data;
$mailer->datasend("this is coming from perl  $a ");  ###
$mailer->dataend;
$mailer->quit;

I need help in few ares:

1. Where I put the Subject:   ?  The email I recieved running
this script had no subject !
2. I really have more data in the script that I need to code into the body
of the email. I am showing a sample ($a)
3. What is the puropse of $mailer->data;
4. how to attach a file or a picture stored either locally or has a link??

I did a lot of research, on these questions, now is the time to ask for help


Send file to printer

2005-02-25 Thread Brian Volk
Hi All,
 
I have been searching Google for a while now and I can not find how to send
a file to the printer.  For example I use the script below to get Material
Safety Data Sheets and store them in a directory ..where I can easily print
them out manually but what I would really like to do is send them to a
printer using a perl script.  Can someone pls point me in the direction of
some documentations on this subject...
 
FYI, I'm using windows  ... only at work though!  :~)
 
Thanks! 
 
use strict;
use warnings;
use LWP::Simple;
 
my $urlfile = 'C:/brian/MSDS/url_20.txt';
my $itemfile = 'C:/brian/MSDS/file_20.txt' ;
 
open(URL, "<", $urlfile) or die "couldn't read urls: $!";
open(ITEM, "<", $itemfile) or die "couldn't read items: $!";
 
my @urls =  ;
my @items= ;
 
close(URL);
close(ITEM);
 
while (@urls) {
   my $url = shift(@urls);
   chomp $url;
   my $file = shift(@items);
   chomp $file;
  
# this line will get and store the msds  
   my $msds = getstore($url,$file);
  }

 
Brian Volk
HP Products
317.298.9950 x1245
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
 
 


Send file to printer

2005-03-24 Thread Brian Volk
Hi All, 
 
I'm trying to send the output file to a network printer.  The program is
working fine as far as producing the file, but it is not being sent to the
printer.  Can someone pls take a look at my program and see if everything
looks Okay.  It may just be the path to the printer, not sure.   Thanks in
advance!
 
---  begin
 
#!/usr/local/bin/perl 
 
use strict;
use warnings;
use File::Copy;
 
my $source_folder = "C:/brian/text_files";
 
my $dest_file = "C:/brian/test/item_file1.txt";
open ITEMFILE, ">$dest_file";
 
# open dir and read the files
 
opendir(FILES,$source_folder);
my @files_to_process = grep {!(/^\./) && -f "$source_folder/$_"} 
readdir(FILES);
closedir (FILES);
 
foreach my $source_file(@files_to_process) {
 

 print ITEMFILE "$source_file\n";
 copy ($source_file, '//HP-EXCH/HP LaserJet 4100(IS)');   
 }
 
close ITEMFILE;
 
---  end
 
Brian Volk
Brian Volk
HP Products
317.298.9950 x1245
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
 
 


Re: Send Mail Issue

2005-06-04 Thread John Doe
Am Samstag, 4. Juni 2005 08.38 schrieb Anish Kumar K:
> This is the program I am using for SENDMAIL. Surprisingly it is not dying.

It even does not compile.

> I could see an error message in the browser as "The System cannot find the
> path specified". I donno from where the message is coming..
> I removed the SENDMAIL part and then checked, now the error is not
> comingI am sure it is with the sendmail. Is it some thing to do with
> the sendmail.
>
> Any other module which will accomplisj the task

For example (code snippet)

 use Mail::Send;

 my $msg = new Mail::Send ( Subject=>$subject,  To=>$email ) or die $!;

 #$msg->set('Reply-To', $Reply_to);
 $msg->set('Bcc', $Bcc);
 $msg->set('From', $From);

 # The filehandle returned is an instance of the Mail::Mailer class.
 my $fh = $msg->open;
 print $fh <close or die; # complete the message and send it

see search.cpan.org for the Mail::Send Module.


> #!/usr/local/bin/perl
> use strict;
> use warnings;
> use CGI;
>
> my $cgi=new CGI;
> print $cgi->header();
> my $name = &clean($cgi->param('name')); // THIS IS FROM THE html FILE
> my $age = &clean($cgi->param('age'));   // THIS IS FROM THE html FILE

$name and $age could be better sanitized: age should only contain numbers, and 
name not all chars, no line breaks etc.

Also try to set a default value to avoid warnings about undefined variables:

 my $age=$cgi->param('age') || '0'; # or whatever
 # TODO: sanitize

"//" is not the way to comment in perl, gives syntax error.

> my $sendmail = "/usr/sbin/sendmail -t";
> my $reply_to = "Reply-to: [EMAIL PROTECTED]";
> my $subject  = "Subject: Confirmation of your submission";
> my $content  = "Thanks for your submission.";
> my $to   = "[EMAIL PROTECTED]";
>
> unless ($to) {
>   print $cgi->header;

The header has already been printed above.

>   print "Please fill in your email and try again";

After that, the program continues...

> }
>
> open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
> print SENDMAIL $reply_to;
> print SENDMAIL $subject;
> print SENDMAIL $to;
> print SENDMAIL "Content-type: text/plain\n\n";
> print SENDMAIL $name;
> print SENDMAIL $description;

$description is not defined.

> close(SENDMAIL);

This could fail.

> print $cgi->header;

The header is printed the 3rd time?!?

> print "Confirmation of your submission will be emailed to you.";

Not sure. The sending could have failed.

> sub clean
> {
>  # Clean up any leading and trailing whitespace
>  # using regular expressions.
>  my $s = shift @_;
>  $s =~ s/^\s+//;
>  $s =~ s/\s+$//;
>  return $s;
> }


joe

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




send a HUP signal

2005-07-23 Thread dan
me again ;)
i don't even know if this is going to be possible, but i'll ask anyway.
my perl program runs as a constant process in the background. is there
anyway i can make another program/script send a HUP, or any kind of, signal
to the process, to say, force a re-read of a database or something, to get
it to act on data sent by a user from a website or something. i don't want
to go to the trouble of trying to build a webserver into the program as
well, if i can simply send a signal to the program, then get the website to
enter data into a specific part of a database, then send a signal to the
process id to get it to (re)read that portion of the database.

thanks for your help,
dan



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




send email with Perl

2005-10-27 Thread Charles Li
Hi,
I am using "use Net::SMTP;" to send email to multiple
people.  But the recipients can not send the other
receiver emails.  It just says undisclosed recipients.
 How do I send email to multiple people and let them
see who is on the To list?

Thanks.




__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




New on Mail::Send

2005-11-16 Thread ZHAO, BING
 I am on Windows XP home edition. I have this software Secure Shell which tunnels to 
a remote host(unix). The remote is very strictly managed, any installation of anything would 
require me to talk to/call up the system administator(this is national security). Then I have this 
home-made module directory, just a dir with lots of *.pm files, I have got away without actually 
downloading any module for a while. ( I usually just copy and paste the raw source code and save 
it under my module dir)
 Any 'make install' would result in Error. Since what I am doing is relatively 
simple, I just dug out the required module from the MailTools-1.67/, like Mail::Send, Mail::Mailer 
etc and save them into my secret home-made module dir and set path to it.



 STOP: any suggestion for me on how to install modules correctly or any doubt for me 
on if I really want to learn to install modules, plz stop. I appreciate your eagerness to show off 
your seniority. And stop making assumption, as I just stated case clear enough. And when it comes 
down to learning/study, very few people could match my intensity.
 
 My point again: I am a perl beginner. I don't care how the perl is developing and 
where perl is going. I am doing stuff way fancier than what you can imagine. I am current doing a 
project with web input and data anaylysis and email feedback. I need to do them and not to think 
why and how perl is like this, why and how perl module works this way. As long as it works, I am 
happy and I am making progress. If the purpose of being on this list is to ask questions and help 
each other out, I am in for it.

I have enough 'living-a-pumped-up-life' phylosophies from my 5,000-year 
cultural heritages.


 Here is my script:

require Mail::Send;
$msg = new Mail::Send;
$msg = new Mail::Send Subject=>'example subject', To=>'Bing Zhao';
$msg->to('[EMAIL PROTECTED]');
$msg->subject('example subject');
$msg->cc('[EMAIL PROTECTED]');
$fh = $msg->open;
print $fh "Body of message";
$fh->close;


With no error regarding the whereabout of the necessary modules, I assume I got the module thing 
right. Then every time, this 'dead.letter' is generated. I guess it's part of the built-in 
function of Mail::Send, when the script fails to send the email. Anyway, here is a copy of the 
dead.letter files:


From bzhao Wed Nov 16 12:13:15 2005
Return-Path: 
Received: (from [EMAIL PROTECTED])
by gly.lbl.gov (8.12.11/8.12.11/Submit) id jAGKDFRT011092;
Wed, 16 Nov 2005 12:13:15 -0800
Date: Wed, 16 Nov 2005 12:13:15 -0800
From: bing zhao 
Message-Id: <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: example subject
To: [EMAIL PROTECTED]
 
Body of message
 
Any CONSTRUCTIVE suggestion on how I should modify my code?


thanks a lot.

best,

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Mail::Send and Taint

2005-11-19 Thread Tom Allison

I think I just got burned on Mail::Send.
I've been using it for months/years with no problem, but now I'm writing 
a web app and Taint won't let me use Mail::Send


Insecure $ENV{PATH} while running with -T switch at 
/usr/share/perl5/Mail/Mailer/sendmail.pm line 16.


What got me is that I call this from code that is already running it 
under the apache config: PerlTaintCheck On.
So how can the $ENV{PATH} be insecure if it passes on all the other 
calls in my code?

I'm assuming that the problem is something like this:
Mail::Send calls for the 'sendmail' alias which is in
/usr/sbin/sendmail
This is not part of my $ENV{PATH} but I didn't set it anywhere, I'm 
assuming that this was set somewhere, but I'm not setting it that I can 
see, nor can I set it to work.


Options?
Ideas?

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




for send an email

2005-12-23 Thread Rafael Morales
Hi list !!!.

I need to send an email to some clients, so I need to know if their mail client 
can accept html format or just text format. How can know that ???, I think that 
there is, some cpan module to do that however I haven't found it.

Could you help me please with this homwork ??? thank you very very much.
Regards.

-- 
___
Get your free email from http://mymail.bsdmail.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




how do send keys

2002-09-05 Thread Tyler, Grayling

How do I start a program in perl and send keystrokes to it??


thanks


This electronic message may contain confidential or privileged information 
and is intended for the individual or entity named above.  If you are 
not the intended recipient, be aware that any disclosure, copying, 
distribution or use of the contents of this information is prohibited. 
If you have received this electronic transmission in error, please notify 
the sender immediately by using the e-mail address or by telephone
(704-633-8250). 





Don't Send To Me!

2003-11-23 Thread Jason Dusek
Hi There,

Is there some way to get people on this list to stop sending me two 
emails at once?  I am on the beginner's list - so when you send email 
to me and then cc to the list, I get two.  Which is annoying.  I 
suppose I could write some rules to kill duplicate messages, but I have 
got stuff to do.  If I post to the list, I think it may be safely 
assumed that I will read it to find out what people have to say about 
my posting.

- Jason

Sparrow called out to himself every morning: "Master."
Then he answered himself: "Yes, boss."
And after that he added: "Don't forget the zucchini."
Again he answered,  "Yes, boss."
And after that, he continued, "Don't be fooled by others."
"Yes, boss. yes, boss,"  he answered.
-Mike Topp

Send in POST method

2003-12-04 Thread max4o
Hi all,
my simple question is, is there a package that can help me to open URL and
send parametters via POST method, not with GET?

Thanks.
Milen H.
-
This mail is from: <[EMAIL PROTECTED]>
-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Send Mail with attachment

2008-10-21 Thread leolim818
Hi All,

I'm using perl module MIME::Lite to sent out email with attachments,
may I know what "Type" should I define to attach any type of files,
for instance .jpg, .xls, .doc, .pdf  and etc without checking the
attached file type. Is there any global variable to define instead of
Type => 'application/zip', Type => 'image/gif', Type => "application/
xls" and etc?

$msg->attach (
   Type => 'what type should I define without checking the attached
file type',
   Path => '$path',
   Filename => '$filename',
   Disposition => 'attachment'
)

Please helps.

Thanks & Regards,
Leo.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Send email using smtp

2009-01-05 Thread Fúlvio
Hi all,

I am trying to send an email using the following code:

use Net::SMTP;

$smtp = Net::SMTP->new("smtp.yahoo.com");
$smtp->mail('fulviocg');

but the error below is happening:

Can't call method "mail" on an undefined value at 

Can someone help me?

Thanks

Fúlvio


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Send email with attachment

2002-04-28 Thread Ahmed Moustafa

Hi All,

Would you post an example of sending an email with attachment(s) using 
Net::SMTP, please?

Thanks in advance.

Ahmed


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Send mail quesiton

2002-05-23 Thread Todd Wade,,,Room 108

Lance Prais wrote:

> All,
>I am trying to  "use Mail::Sendmail" to send mail.  The problem is that
> the sendmail is in the right folder.  The only thing that comes to mind is
> that I am doing this on NT
> 
> The path for the sendmail.pm is   perl/lib/mail/sendmail.pm
> 
> I am getting the following error:
> 
> E:\sea621\siebsrvr\BIN>emailmgr.pl
> Can't locate Mail/Sendmail.pm in @INC (@INC contains:
> E:/sea621/siebsrvr/BIN/lib
>  E:/sea621/siebsrvr/BIN/site/lib .) at E:\sea621\siebsrvr\BIN\emailmgr.pl
> line 3
> 0.
> BEGIN failed--compilation aborted at E:\sea621\siebsrvr\BIN\emailmgr.pl
> line 30.
> 

Either make a directory called Mail in E:/sea621/siebsrvr/BIN/site/lib and 
put Sendmail.pm in it or put the statement:

use lib qw(E:/perl/lib);

at the beginning of emailmgr.pl

Todd W

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Send mail quesiton

2002-05-23 Thread Lance Prais

Todd,
   Thanks for your help but I tried both and received the same results.
First I tried placing use lib qw(E:/perl/lib); at the beginning of my code
like this:

#!perl -w
#/usr/bin/perl
use lib qw(E:/perl/lib);

$cmd = 'srvrmgr /g apollo.ts.checkpoint.com /e CHK_ENT_PRD /s CHK_SBL_PRD /u
xx /p xx /c "list tasks for server CHK_SBL_PRD component Email
Manager" > emailmgr.txt';
$result = `$cmd`;   # note back-ticks

#open a file with the filehandle
open EMAILMGR, "+<..\\..\\emailmgr.txt"  or die "Cannot open email manager
$!\n";

#my $data =  for (1..22);  #Testing to make sure I am
#grabbing the correct data
for(my $i=0; $i<22; $i++){};   #This will put you at row 23.
  $_=;
  my $line=$_;

if (substr($line, 42, 7) eq "Running")
{
 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
 open (APPEND, ">>Moniterlog.log") or die "$! error trying to append";
  if ($hour> 12)
  {
print APPEND "Successfully Completed Email Manager Moniter
",$hour-12,":$min\n";
   }
  else
  {
print APPEND "Successfully Completed Email Manager Moniter
$hour:$min\n";
  }
}
else
{
  use Mail::Sendmail;#Send and email if there are errors
  %mail = ( To  =>  '[EMAIL PROTECTED]',
From=>  '[EMAIL PROTECTED]',
Subject =>  '',
Message =>   'Email Manager: '.substr($line, 95, 17),
   );
  sendmail(%mail) or die $Mail::Sendmail::error;
  print "OK. Log says:\n", $Mail::Sendmail::log;
}


Received the following error:


E:\sea621\siebsrvr\BIN>emailmgr.pl
Can't locate Mail/Sendmail.pm in @INC (@INC contains:
E:/sea621/siebsrvr/BIN/lib
 E:/sea621/siebsrvr/BIN/site/lib .) at E:\sea621\siebsrvr\BIN\emailmgr.pl
line 3
0.
BEGIN failed--compilation aborted at E:\sea621\siebsrvr\BIN\emailmgr.pl line
30.


Then placed sendmail.pm in the following folder:
sea621/siebsrvr/BIN/site/lib/mail/sendmail.pm  And got the same error.  It
is bizarre.

Thanks
Lance
-Original Message-
From: Todd Wade,,,Room 108 [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 12:11 PM
To: [EMAIL PROTECTED]
Subject: Re: Send mail quesiton

Lance Prais wrote:

> All,
>I am trying to  "use Mail::Sendmail" to send mail.  The problem is that
> the sendmail is in the right folder.  The only thing that comes to mind is
> that I am doing this on NT
>
> The path for the sendmail.pm is   perl/lib/mail/sendmail.pm
>
> I am getting the following error:
>
> E:\sea621\siebsrvr\BIN>emailmgr.pl
> Can't locate Mail/Sendmail.pm in @INC (@INC contains:
> E:/sea621/siebsrvr/BIN/lib
>  E:/sea621/siebsrvr/BIN/site/lib .) at E:\sea621\siebsrvr\BIN\emailmgr.pl
> line 3
> 0.
> BEGIN failed--compilation aborted at E:\sea621\siebsrvr\BIN\emailmgr.pl
> line 30.
>

Either make a directory called Mail in E:/sea621/siebsrvr/BIN/site/lib and
put Sendmail.pm in it or put the statement:

use lib qw(E:/perl/lib);

at the beginning of emailmgr.pl

Todd W

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to send attacments>

2001-04-24 Thread a

How do i send an html file as an attachment using sendmail?
Thanks




Send e-mail attachment

2001-11-27 Thread paul beckett (JIC)

Does anybody know how I can send a smallish binary file as an e-mail
attachment, from perl (running on UNIX (OSFv.4.0))

Thanks

Paul

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How can I send an HTML format email using send mail

2001-12-17 Thread Agustin Rivera

I've sent you a private message with a script.  I didn't think it would be
appropriate to post that much code to the list.

Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com



- Original Message -
From: "jeff" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 9:37 AM
Subject: How can I send an HTML format email using send mail


> Does anyone know how to send an HTML formatted email using sendmail.  I
can
> send plain text email OK.  If I format the message using HTML the message
> shows the HTML tags.  I can't find any information regarding this on cpan.
> Are there any other modules that have this capability?  Any help is
greatly
> appreciated.
>
> Jeff
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How can I send an HTML format email using send mail

2001-12-17 Thread Jenda Krynicky

From:   "jeff" <[EMAIL PROTECTED]>

> Does anyone know how to send an HTML formatted email using sendmail. 
> I can send plain text email OK.  If I format the message using HTML
> the message shows the HTML tags.  I can't find any information
> regarding this on cpan. Are there any other modules that have this
> capability?  Any help is greatly appreciated.
> 
> Jeff

Try MIME-lite or Mail::Sender.
Both on CPAN.

Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How can I send an HTML format email using send mail

2001-12-17 Thread Scott Lutz

You have to make sure to include the appropriate content type.

open (MAIL, "|/usr/sbin/sendmail -t -oi") || die "Can't fork for
sendmail:$!\n";
print MAIL <http://www.paconline.net



-Original Message-
From: jeff [mailto:[EMAIL PROTECTED]]
Sent: December 17, 2001 9:38 AM
To: [EMAIL PROTECTED]
Subject: How can I send an HTML format email using send mail


Does anyone know how to send an HTML formatted email using sendmail.  I
can
send plain text email OK.  If I format the message using HTML the
message
shows the HTML tags.  I can't find any information regarding this on
cpan.
Are there any other modules that have this capability?  Any help is
greatly
appreciated.

Jeff


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How can I send an HTML format email using send mail

2001-12-17 Thread Michael R. Wolf

"jeff" <[EMAIL PROTECTED]> writes:

> Does anyone know how to send an HTML formatted email using sendmail.  I can
> send plain text email OK.  If I format the message using HTML the message
> shows the HTML tags.  I can't find any information regarding this on cpan.
> Are there any other modules that have this capability?  Any help is greatly
> appreciated.

There are lots of folks that prefer text mai.  Please
consider them when you impose HTML on them.

As a buddy of mine said:

ASCII is God's Language 
-- John Rako


Thanks for your compatability,
Michael

-- 
Michael R. Wolf
All mammals learn by playing!
   [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How can I send an HTML format email using send mail

2001-12-18 Thread Mike Gargiullo

Be nice to those who choose not to receive html mail:



open (MAIL, "|/usr/sbin/sendmail -t -oi") || die "Can't fork for
sendmail:$!\n";
print MAIL <


HTML mail here






--_=_NextPart--
EOF
close(MAIL) || warn "sendmail didn't close nicely\n";





-Original Message-
From: Scott Lutz [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 17, 2001 3:30 PM
To: jeff; [EMAIL PROTECTED]
Subject: RE: How can I send an HTML format email using send mail


You have to make sure to include the appropriate content type.

open (MAIL, "|/usr/sbin/sendmail -t -oi") || die "Can't fork for
sendmail:$!\n";
print MAIL <http://www.paconline.net



-Original Message-
From: jeff [mailto:[EMAIL PROTECTED]]
Sent: December 17, 2001 9:38 AM
To: [EMAIL PROTECTED]
Subject: How can I send an HTML format email using send mail


Does anyone know how to send an HTML formatted email using sendmail.  I
can
send plain text email OK.  If I format the message using HTML the
message
shows the HTML tags.  I can't find any information regarding this on
cpan.
Are there any other modules that have this capability?  Any help is
greatly
appreciated.

Jeff


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How can I send an HTML format email using send mail

2001-12-18 Thread Michael R. Wolf

"Mike Gargiullo" <[EMAIL PROTECTED]> writes:

> open (MAIL, "|/usr/sbin/sendmail -t -oi") || die "Can't fork for
> sendmail:$!\n";
> print MAIL < From: from_email_address
> To: to_email_address
> Subject: subject here
> Date: date here
> MIME-Version: 1.0
> Content-Type: multipart/alternative;
>   boundary="_=_NextPart"
> 
> --_=_NextPart
> Content-Type: text/plain;
>   charset="iso-8859-1"
> plain text here

Thanks for providing the skeleton for OP to be
text-friendly.

Is there a html2text script that can be used to prevent the
writer from creating 2 versions?  This reeks of maintenance
headaches.


> --_=_NextPart
> Content-Type: text/html;
>   charset="iso-8859-1"
>   
>   
>   
> 
> HTML mail here
> 
> 
> 
> 
> 
> 
> --_=_NextPart--
> EOF
> close(MAIL) || warn "sendmail didn't close nicely\n";

-- 
Michael R. Wolf
All mammals learn by playing!
   [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Need help with Email::Send

2009-06-21 Thread Dennis G. Wicks

Greetings;

I can't seem to find the problem with the Email::Send 
portion of this program. It may be that I am getting an 
error from the smtp server but I haven't been able to adapt 
an error routine that works with Mail::Sender to work with 
Email::Send.


Anybody have any insights?

Many thanks,
Dennis

<< Program follows >>


#!/usr/bin/perl

use strict;
use warnings;

use Email::Send;
use Mail::Builder;

  my $mail = Mail::Builder->new();

  $mail->from('t...@mgssub.com','TFRG');
  $mail->to->add('dgwi...@gmail.com','Dennis Wicks');
  $mail->subject('Testing Email::Send and Mail::Builder Again');
  $mail->htmltext('Testing perl email modules  This is a test of the 
Email::Send and Mail::Builder modules. ');
  $mail->plaintext('You must view as html mail');

my $sender = Email::Send->new({mailer => 'SMTP'});
 $sender->mailer_args([Host => 'smtpout.secureserver.net:3535'],
[username => 't...@mgssub.com'],
[password => '']);
 $sender->send($mail -> stringify);



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Email does not send attachment ...

2009-12-08 Thread Tony Esposito
Hello,

I am using Perl 5.8 on WindowsXP and Windows Server 2003.  I can not get the 
following attachment to arrive/attach even though I get the email with no 
issues.  Any ideas?

  use MIME::Lite;
 use Net::SMTP;
 
 unless (-e 'C:/my_file.log' && -s 'C:/my_file.log' ) { print "file not 
found\n"; }
 
  my $msg = MIME::Lite->new (
    From => 'my_em...@yahoo.com',
    To => 'your_em...@yahoo.com',
    Subject => 'Testing error email',
    Type =>'multipart/mixed'
  ) or die "Error creating multipart container: $!\n";
  
 $msg->attach (
    Type => 'TEXT',
    Data => 'Error in the module that caused this email',
  ) or die "Error adding the body text to email message: $!\n";
 
   $msg->attach (
 Type => 'TEXT',
 Path => 'C:/my_file.log',
 Filename => 'my_file.log',
 Disposition => 'attachment'
 ) or die "Error adding file attachment: $!\n";

  MIME::Lite->send('smtp', 'smtp.server.net', Timeout=>60);
  $msg->send; 
 
__END__

Thank you!


  

Re: Send mail using SSL

2010-01-11 Thread Gurunandan R. Bhat

Use Email::Sender::Transport::SMTP 


> a
> I want to send mail using ssl with smtp server. Does Mail::Sender support
> SSL? Or must I use Net::Smtp::SSL ?
> 
> Regards,
> Thomas.
> 
> 




RE: Send mail using SSL

2010-01-12 Thread Thomas Yan
Thanks. But I can't find how to send attachment using Email::Sender on CPAN. Or 
maybe I am not careful enough to find it.

Is there any module easy to send attachments over ssl?

-Original Message-
From: Gurunandan R. Bhat [mailto:g...@dygnos.com] 
Sent: Tuesday, January 12, 2010 2:52 PM
To: Thomas Yan
Cc: beginners@perl.org
Subject: Re: Send mail using SSL


Use Email::Sender::Transport::SMTP 


> a
> I want to send mail using ssl with smtp server. Does Mail::Sender support
> SSL? Or must I use Net::Smtp::SSL ?
> 
> Regards,
> Thomas.
> 
> 




-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




RE: Send mail using SSL

2010-01-12 Thread Gurunandan R. Bhat

Look up the documentation for Email::Sender::Manual::QuickStart. It has
a nice example for a MIME::Entity with an attachment.

Regards


On Tue, 2010-01-12 at 16:11 +0800, Thomas Yan wrote: 
> Thanks. But I can't find how to send attachment using Email::Sender on CPAN. 
> Or maybe I am not careful enough to find it.
> 
> Is there any module easy to send attachments over ssl?
> 
> -Original Message-
> From: Gurunandan R. Bhat [mailto:g...@dygnos.com] 
> Sent: Tuesday, January 12, 2010 2:52 PM
> To: Thomas Yan
> Cc: beginners@perl.org
> Subject: Re: Send mail using SSL
> 
> 
> Use Email::Sender::Transport::SMTP 
> 
> 
> > a
> > I want to send mail using ssl with smtp server. Does Mail::Sender support
> > SSL? Or must I use Net::Smtp::SSL ?
> > 
> > Regards,
> > Thomas.
> > 
> > 
> 
> 
> 




-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Fine tuning gmail send

2012-09-26 Thread Shlomi Fish
Hi Samir,

a few comments on your code:

On Wed, 26 Sep 2012 14:29:15 +0200
Samir Arishy  wrote:

> This code is working.
> 

1. Add "use strict;" and "use warnings;".

> use Net::SMTP::TLS;
> my $mailer = new Net::SMTP::TLS(
>  'smtp.gmail.com',
>  Hello   =>  'smtp.gmail.com',
>  Port=>  587,
>  User=>  'amyID',
>  Password=>  'myPW');

Don't use indirect object notation:

* http://perl-begin.org/tutorials/bad-elements/#indirect-object-notation

* 
http://www.modernperlbooks.com/mt/2009/08/the-problems-with-indirect-object-notation.html

> 
> $a="data from some calculation inside the script.";
> 

You should not use $a as a variable because it is a built-in variable with 
special
uses in sort() and other functions:

http://perl-begin.org/tutorials/bad-elements/#vars-a-and-b

> $mailer->mail('x...@y.com');
> $mailer->to('a...@b.com');
> $mailer->data;
> $mailer->datasend("this is coming from perl  $a ");  ###
> $mailer->dataend;
> $mailer->quit;
> 
> I need help in few ares:
> 
> 1. Where I put the Subject:   ?  The email I recieved
> running this script had no subject !

The Subject is part of the MIME headers. Maybe try:

* https://metacpan.org/module/Email::MIME

* https://metacpan.org/release/Email-Sender

instead.

> 2. I really have more data in the script that I need to code into the
> body of the email. I am showing a sample ($a)

So? What is the issue?

> 3. What is the puropse of $mailer->data;

I think it means to start sending the data.

> 4. how to attach a file or a picture stored either locally or has a
> link??
> 

You need MIME for that. Try looking into Email::Sender and Email::MIME .

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Apple Inc. is Evil - http://www.shlomifish.org/open-source/anti/apple/

Chuck Norris is a real programmer. He writes programs by implementing the most
optimised machines for them using real atoms.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Fine tuning gmail send

2012-09-26 Thread Shlomi Fish
Hi Samir,

please avoid replying to me in private (as I specifically request in my
signature), and instead reply to the list. I am now replying to the list.

You should also avoid top-posting, which makes your messages hard to follow:

http://en.wikipedia.org/wiki/Posting_style

I am going to reply to the list.
 
On Wed, 26 Sep 2012 17:29:08 +0200
Samir Arishy  wrote:

> Well, it seems I need extra modules to do such a simple task !!!
> I will definetly "follow the links"

Well, these are not "extra" modules - these are alternative modules, which
hopefully do things better. There's a limit to how much functionality
one should put in the perl core language, and that's what CPAN is for.
See:

http://shadow.cat/blog/matt-s-trout/but-i-cant-use-cpan/

> 
> As for point 3. My concern was; I need to compose a BODY with lots of
> data and doing it my way is rather limited

OK, how would you like to generate the data section in the message?

See:

http://perl-begin.org/uses/text-generation/

> By my way I mean:> $mailer->datasend("this is coming from perl $a
> "); Actually $a was just to simplify the example, my variables are
> very descriptive. But thanks for your remark.

You're welcome. Next time use some more meaningful variable names in
the example.

Regards,

Shlomi Fish

> On Wed, Sep 26, 2012 at 4:49 PM, Shlomi Fish 
> wrote:
> 
> > Hi Samir,
> >
> > a few comments on your code:
> >
> > On Wed, 26 Sep 2012 14:29:15 +0200
> > Samir Arishy  wrote:
> >
> > > This code is working.
> > >
> >
> > 1. Add "use strict;" and "use warnings;".
> >
> > > use Net::SMTP::TLS;
> > > my $mailer = new Net::SMTP::TLS(
> > >  'smtp.gmail.com',
> > >  Hello   =>  'smtp.gmail.com',
> > >  Port=>  587,
> > >  User=>  'amyID',
> > >  Password=>  'myPW');
> >
> > Don't use indirect object notation:
> >
> > *
> > http://perl-begin.org/tutorials/bad-elements/#indirect-object-notation
> >
> > *
> > http://www.modernperlbooks.com/mt/2009/08/the-problems-with-indirect-object-notation.html
> >
> > >
> > > $a="data from some calculation inside the script.";
> > >
> >
> > You should not use $a as a variable because it is a built-in
> > variable with special
> > uses in sort() and other functions:
> >
> > http://perl-begin.org/tutorials/bad-elements/#vars-a-and-b
> >
> > > $mailer->mail('x...@y.com');
> > > $mailer->to('a...@b.com');
> > > $mailer->data;
> > > $mailer->datasend("this is coming from perl  $a ");  ###
> > > $mailer->dataend;
> > > $mailer->quit;
> > >
> > > I need help in few ares:
> > >
> > > 1. Where I put the Subject:   ?  The email I recieved
> > > running this script had no subject !
> >
> > The Subject is part of the MIME headers. Maybe try:
> >
> > * https://metacpan.org/module/Email::MIME
> >
> > * https://metacpan.org/release/Email-Sender
> >
> > instead.
> >
> > > 2. I really have more data in the script that I need to code into
> > > the body of the email. I am showing a sample ($a)
> >
> > So? What is the issue?
> >
> > > 3. What is the puropse of $mailer->data;
> >
> > I think it means to start sending the data.
> >
> > > 4. how to attach a file or a picture stored either locally or has
> > > a link??
> > >
> >
> > You need MIME for that. Try looking into Email::Sender and
> > Email::MIME .
> >
> > Regards,
> >
> > Shlomi Fish
> >
> > --
> > -
> > Shlomi Fish   http://www.shlomifish.org/
> > Apple Inc. is Evil -
> > http://www.shlomifish.org/open-source/anti/apple/
> >
> > Chuck Norris is a real programmer. He writes programs by
> > implementing the most
> > optimised machines for them using real atoms.
> >
> > Please reply to list if it's a mailing list post -
> > http://shlom.in/reply .
> >
> > --
> > To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> > For additional commands, e-mail: beginners-h...@perl.org
> > http://learn.perl.org/
> >
> >
> >



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Understand what Open Source is - http://shlom.in/oss-fs

Bugs are too afraid to reproduce on Chuck Norris’ computer. As a result, when
he uses Microsoft Windows, it behaves just like a Linux system.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Fine tuning gmail send

2012-09-26 Thread Samir Arishy
<< how would you like to generate the data section in the message?>>

I checked the link you kindly sent me, and I actually used it in my example.
So, I can put in my script  :

$my_email_body= "

then
$mailer->datasend("$my_email_body ");

On Wed, Sep 26, 2012 at 5:51 PM, Shlomi Fish  wrote:

> Hi Samir,
>
> please avoid replying to me in private (as I specifically request in my
> signature), and instead reply to the list. I am now replying to the list.
>
> You should also avoid top-posting, which makes your messages hard to
> follow:
>
> http://en.wikipedia.org/wiki/Posting_style
>
> I am going to reply to the list.
>
> On Wed, 26 Sep 2012 17:29:08 +0200
> Samir Arishy  wrote:
>
> > Well, it seems I need extra modules to do such a simple task !!!
> > I will definetly "follow the links"
>
> Well, these are not "extra" modules - these are alternative modules, which
> hopefully do things better. There's a limit to how much functionality
> one should put in the perl core language, and that's what CPAN is for.
> See:
>
> http://shadow.cat/blog/matt-s-trout/but-i-cant-use-cpan/
>
> >
> > As for point 3. My concern was; I need to compose a BODY with lots of
> > data and doing it my way is rather limited
>
> OK, how would you like to generate the data section in the message?
>
> See:
>
> http://perl-begin.org/uses/text-generation/
>
> > By my way I mean:> $mailer->datasend("this is coming from perl $a
> > "); Actually $a was just to simplify the example, my variables are
> > very descriptive. But thanks for your remark.
>
> You're welcome. Next time use some more meaningful variable names in
> the example.
>
> Regards,
>
> Shlomi Fish
>
> > On Wed, Sep 26, 2012 at 4:49 PM, Shlomi Fish 
> > wrote:
> >
> > > Hi Samir,
> > >
> > > a few comments on your code:
> > >
> > > On Wed, 26 Sep 2012 14:29:15 +0200
> > > Samir Arishy  wrote:
> > >
> > > > This code is working.
> > > >
> > >
> > > 1. Add "use strict;" and "use warnings;".
> > >
> > > > use Net::SMTP::TLS;
> > > > my $mailer = new Net::SMTP::TLS(
> > > >  'smtp.gmail.com',
> > > >  Hello   =>  'smtp.gmail.com',
> > > >  Port=>  587,
> > > >  User=>  'amyID',
> > > >  Password=>  'myPW');
> > >
> > > Don't use indirect object notation:
> > >
> > > *
> > > http://perl-begin.org/tutorials/bad-elements/#indirect-object-notation
> > >
> > > *
> > >
> http://www.modernperlbooks.com/mt/2009/08/the-problems-with-indirect-object-notation.html
> > >
> > > >
> > > > $a="data from some calculation inside the script.";
> > > >
> > >
> > > You should not use $a as a variable because it is a built-in
> > > variable with special
> > > uses in sort() and other functions:
> > >
> > > http://perl-begin.org/tutorials/bad-elements/#vars-a-and-b
> > >
> > > > $mailer->mail('x...@y.com');
> > > > $mailer->to('a...@b.com');
> > > > $mailer->data;
> > > > $mailer->datasend("this is coming from perl  $a ");  ###
> > > > $mailer->dataend;
> > > > $mailer->quit;
> > > >
> > > > I need help in few ares:
> > > >
> > > > 1. Where I put the Subject:   ?  The email I recieved
> > > > running this script had no subject !
> > >
> > > The Subject is part of the MIME headers. Maybe try:
> > >
> > > * https://metacpan.org/module/Email::MIME
> > >
> > > * https://metacpan.org/release/Email-Sender
> > >
> > > instead.
> > >
> > > > 2. I really have more data in the script that I need to code into
> > > > the body of the email. I am showing a sample ($a)
> > >
> > > So? What is the issue?
> > >
> > > > 3. What is the puropse of $mailer->data;
> > >
> > > I think it means to start sending the data.
> > >
> > > > 4. how to attach a file or a picture stored either locally or has
> > > > a link??
> > > >
> > >
> > > You need MIME for that. Try looking into Email::Sender and
> > > Email::MIME .
> > >
> > > Regards,
> > >
> > > Shlomi Fish
> > >
> > > --
> > > -
> > > Shlomi Fish   http://www.shlomifish.org/
> > > Apple Inc. is Evil -
> > > http://www.shlomifish.org/open-source/anti/apple/
> > >
> > > Chuck Norris is a real programmer. He writes programs by
> > > implementing the most
> > > optimised machines for them using real atoms.
> > >
> > > Please reply to list if it's a mailing list post -
> > > http://shlom.in/reply .
> > >
> > > --
> > > To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> > > For additional commands, e-mail: beginners-h...@perl.org
> > > http://learn.perl.org/
> > >
> > >
> > >
>
>
>
> --
> -
> Shlomi Fish   http://www.shlomifish.org/
> Understand what Open Source is - http://shlom.in/oss-fs
>
> Bugs are too afraid to reproduce on Chuck Norris’ computer. As a result,
> when
> he uses Microsoft Windows, it behaves just like a Linux system.
>
> Please reply to list if it's a mailing list post - http://shlom.in/reply .
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@

Re: Fine tuning gmail send

2012-09-26 Thread Leo Susanto
Basic script for gmail with subject:

use strict;
use Net::SMTP::TLS;
our $MAIL;
do "mail.conf";
my $mailer = new Net::SMTP::TLS(
 $$MAIL{'Host'},
 Hello   => $$MAIL{'Hello'},
 Port=> $$MAIL{'Port'},
 User=> $$MAIL{'User'},
 Password=> $$MAIL{'Password'},
 Timeout => 10,
 Debug   => 1,
);
$mailer->mail("$from");
$mailer->to("$to");
$mailer->data;
$mailer->datasend("To: $to\n");
$mailer->datasend("Subject: subject\n");
$mailer->datasend("\n");
$mailer->datasend("Additional data: $a");
$mailer->dataend;
$mailer->quit;

To attach text file it's quite easy
  # http://en.wikipedia.org/wiki/MIME#Multipart_messages
  $smtp->mail($from);
  $smtp->to($to);
  $smtp->data();
  $smtp->datasend("To: $to\n");
  $smtp->datasend("Subject: subject\n");
  $smtp->datasend("MIME-Version: 1.0\n");
  $smtp->datasend("Content-Type: multipart/mixed;
boundary=\"BLABLABLA\"\n");
  $smtp->datasend("--BLABLABLA\n");
  $smtp->datasend("Content-Type: text/plain\n\n"); # body
  $smtp->datasend("$msgTXT\n");
  $smtp->datasend("--BLABLABLA\n");
  $smtp->datasend("Content-Type: application/text;
name=attachment.txt\n\n");
  $smtp->datasend($textoffile);
  $smtp->dataend();
  $smtp->quit;

To attach binary file such as zip/jpg file
  my $zipFileContent;
  {
local $/ = undef;
open ZIPFILE, "file.zip";
binmode ZIPFILE;
$zipFileContent = ;
close ZIPFILE;
  }
  $smtp->mail($from);
  $smtp->to($to);
  $smtp->data();
  $smtp->datasend("To: $to\n");
  $smtp->datasend("Subject: subject\n");
  $smtp->datasend("MIME-Version: 1.0\n");
  $smtp->datasend("Content-Type: multipart/mixed;
boundary=\"BLABLABLA\"\n");
  $smtp->datasend("--BLABLABLA\n");
  $smtp->datasend("Content-Type: text/plain\n\n"); # body
  $smtp->datasend("$msgTXT\n");
  $smtp->datasend("--BLABLABLA\n");
  $smtp->datasend("Content-Type: application/zip; name=attachment.zip\n");
  $smtp->datasend("Content-Transfer-Encoding: base64\n\n");
  use MIME::Base64;
  $smtp->datasend(encode_base64($zipFileContent));
  $smtp->dataend();
  $smtp->quit;

On Wed, Sep 26, 2012 at 5:29 AM, Samir Arishy  wrote:
> This code is working.
>
> use Net::SMTP::TLS;
> my $mailer = new Net::SMTP::TLS(
>  'smtp.gmail.com',
>  Hello   =>  'smtp.gmail.com',
>  Port=>  587,
>  User=>  'amyID',
>  Password=>  'myPW');
>
> $a="data from some calculation inside the script.";
>
> $mailer->mail('x...@y.com');
> $mailer->to('a...@b.com');
> $mailer->data;
> $mailer->datasend("this is coming from perl  $a ");  ###
> $mailer->dataend;
> $mailer->quit;
>
> I need help in few ares:
>
> 1. Where I put the Subject:   ?  The email I recieved running
> this script had no subject !
> 2. I really have more data in the script that I need to code into the body
> of the email. I am showing a sample ($a)
> 3. What is the puropse of $mailer->data;
> 4. how to attach a file or a picture stored either locally or has a link??
>
> I did a lot of research, on these questions, now is the time to ask for help

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Fine tuning gmail send

2012-09-26 Thread Shlomi Fish
Hello Leo,

see my comments on your code below.

On Wed, 26 Sep 2012 09:52:55 -0700
Leo Susanto  wrote:

> Basic script for gmail with subject:
> 
>   use strict;

You should also use "use warnings;".

>   use Net::SMTP::TLS;
>   our $MAIL;

Why "our" instead of "my"? And why is "$MAIL" spelled in all-capital-letters?
>   do "mail.conf";

Ouch! Use modules and subroutines for configuration. Don't use the file version
of "do".

You're also missing empty lines.

>   my $mailer = new Net::SMTP::TLS(
>$$MAIL{'Host'},
>Hello   => $$MAIL{'Hello'},
>Port=> $$MAIL{'Port'},
>User=> $$MAIL{'User'},
>Password=> $$MAIL{'Password'},
>Timeout => 10,
>Debug   => 1,
>   );

$$MAIL{'Host'} is better written as $mail_params->{'Host'}
or even $mail_params->{Host}.

>   $mailer->mail("$from");
>   $mailer->to("$to");
>   $mailer->data;
>   $mailer->datasend("To: $to\n");
>   $mailer->datasend("Subject: subject\n");
>   $mailer->datasend("\n");
>   $mailer->datasend("Additional data: $a");
>   $mailer->dataend;
>   $mailer->quit;
> 
> To attach text file it's quite easy
>   # http://en.wikipedia.org/wiki/MIME#Multipart_messages
>   $smtp->mail($from);
>   $smtp->to($to);
>   $smtp->data();
>   $smtp->datasend("To: $to\n");
>   $smtp->datasend("Subject: subject\n");
>   $smtp->datasend("MIME-Version: 1.0\n");
>   $smtp->datasend("Content-Type: multipart/mixed;
> boundary=\"BLABLABLA\"\n");
>   $smtp->datasend("--BLABLABLA\n");
>   $smtp->datasend("Content-Type: text/plain\n\n"); # body

Please don't mangle MIME directly - it is error-prone and there are modules
to do it in a better way.

>   $smtp->datasend("$msgTXT\n");
>   $smtp->datasend("--BLABLABLA\n");
>   $smtp->datasend("Content-Type: application/text;
> name=attachment.txt\n\n");
>   $smtp->datasend($textoffile);
>   $smtp->dataend();
>   $smtp->quit;
> 
> To attach binary file such as zip/jpg file
>   my $zipFileContent;
>   {
> local $/ = undef;
> open ZIPFILE, "file.zip";
> binmode ZIPFILE;
> $zipFileContent = ;
> close ZIPFILE;
>   }

Please use File::Slurp or something (or Email::MIME or whatever).

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs

Chuck Norris wrote a complete Perl 6 implementation in a day, but then
destroyed all evidence with his bare hands, so no‐one will know his secrets.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Format and send a file

2004-11-30 Thread Rafael Morales
Hi list.

I tapeworm a disordered file which I repair it and produces this exit to me in 
my shell:

UNIDAD  |   
 TOTAL
|--
UNIDAD PARA LA PROMOCION Y DEFENSA DE LOS DERECHOS HUMANOS  |   
  1
UNIDAD PARA LA ATENCION DE LAS ORGANIZACIONES SOCIALES  |   
  1
UNIDAD DE ENLACE LEGISLATIVO|   
  2
UNIDAD DE CONTRALORIA INTERNA   |   
  1
SUBSECRETARIA DE POBLACION,MIGRACION Y ASUNTOS RELIGIOSOS   |   
  1
SUBSECRETARIA DE NORMATIVIDAD DE MEDIOS |   
  3
SUBSECRETARIA DE ENLACE LEGISLATIVO |   
  1
SECRETARIA  |   
  4
DIRECCIÓN GENERAL DE DESARROLLO POLÍTICO|   
  1
DIRECCION GENERAL DE TECNOLOGIAS DE LA INFORMACION  |   
  3
DIRECCION GENERAL DE MEDIOS IMPRESOS|   
  1
DIRECCION GENERAL DE COMUNICACION SOCIAL|   
  1
COORDINACION GENERAL DE LA COMISION MEXICANA DE AYUDA A REFUGIADOS  |   
  4
-- UNIDAD SIN DEFINICION -- |   
  1

14 rows selected.

But when I send it by email the exit is disordered. How could I send this file 
and receive it ordered in the inbox 

This my code:

#!/usr/bin/perl
use strict;

  my $rmorales = "[EMAIL PROTECTED]";  #- Correo de Rafael Morales
  my $alertas  = "alertaMail.log";  #- Archivo que contiene la 
informacion de alertas

  open MAIL,"|mail $rmorales" || warn "No se ha encontrado la direccion de 
correo\n$!";
  open (ALERTAS, "<$alertas") || die "No se ha encontrado el archivo 
$alertas\n$!"; 
  open (TOTAL, ">total.txt") || die "No se puede escribir en el archivo 
total.txt\n$!"; 

  foreach ()
  {
  $_=~ s/(\w)\s\t/$1/;
  $_=~ s/(--)\t\t/$1/;
  print TOTAL "$_";
  print MAIL "$_\n";
  }
  close (ALERTAS);


Regards.
-- 
___
Get your free email from http://mymail.bsdmail.com

Powered by Outblaze

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Send file to printer

2005-03-24 Thread Offer Kaye
On Wed, 23 Mar 2005 16:05:53 -0500, Brian Volk wrote:
> Hi All,
> 
> I'm trying to send the output file to a network printer.  The program is
> working fine as far as producing the file, but it is not being sent to the
> printer.  Can someone pls take a look at my program and see if everything
> looks Okay.  It may just be the path to the printer, not sure.   Thanks in
> advance!
> 
>  copy ($source_file, '//HP-EXCH/HP LaserJet 4100(IS)');

What makes you think that File::Copy's "copy" supports printing
directly to a printer this way? According to "perldoc File::Copy", if
the argument is a string, it is assumed to be the name of a file. This
is not the case here, so I doubt this will work...

I suggest either using the Net::Printer module
(http://search.cpan.org/dist/Net-Printer/) or manually opening a
filehandle to an "lp" process and providing that filehandle as the
argument to "copy".

Hope this helps,
-- 
Offer Kaye

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: Send file to printer

2005-03-24 Thread Brian Volk
> 
> On Wed, 23 Mar 2005 16:05:53 -0500, Brian Volk wrote:
> > Hi All,
> > 
> > I'm trying to send the output file to a network printer.  
> The program is
> > working fine as far as producing the file, but it is not 
> being sent to the
> > printer.  Can someone pls take a look at my program and see 
> if everything
> > looks Okay.  It may just be the path to the printer, not 
> sure.   Thanks in
> > advance!
> > 
> >  copy ($source_file, '//HP-EXCH/HP LaserJet 
> 4100(IS)');
> 
> What makes you think that File::Copy's "copy" supports printing
> directly to a printer this way? According to "perldoc File::Copy", if
> the argument is a string, it is assumed to be the name of a file. This
> is not the case here, so I doubt this will work...
> 
> I suggest either using the Net::Printer module
> (http://search.cpan.org/dist/Net-Printer/) or manually opening a
> filehandle to an "lp" process and providing that filehandle as the
> argument to "copy".
> 
> Hope this helps,
> -- 
> Offer Kaye


Thank you for the response, I will look into using Net::Printer.

To answer your question.  "What makes you think that File::Copy's "copy"
supports printing
directly to a printer this way?"  I was google'ing and found this

 Google "perlmonks.thepen.com/158993.html"
---
Answer: How do I send a file to the printer on Win32? contributed by munchie
It's very easy, as I recently discovered.

use File::Copy;

copy($file,'lpt1:');


 
Answer: How do I send a file to the printer on Win32? contributed by
Anonymous Monk
There is also another trick to write directly to a named printer, assuming
the printer is shared and using the UNC syntax:

copy($file,'//host/printername');

--

Thanks!

Brian Volk 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Send file to printer

2005-03-24 Thread Offer Kaye
On Thu, 24 Mar 2005 08:11:42 -0500, Brian Volk wrote:
>
> To answer your question.  "What makes you think that File::Copy's "copy"
> supports printing
> directly to a printer this way?"  I was google'ing and found this
> 
>  Google "perlmonks.thepen.com/158993.html"

Well, that looks like your code and since I don't really know anything
about printing from Perl on a Windows network I can't say what's
wrong.  Did you check the last sentance:
   "assuming the printer is shared and using the UNC syntax"

Another guess - maybe the problem is the whitespaces in the printer
name. Try escaping them using backslashes:
copy ($source_file, '//HP-EXCH/HP\ LaserJet\ 4100(IS)');

I would also try changing the single quotes to double quotes.

Hope this helps,
-- 
Offer Kaye

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Send file to printer

2005-03-24 Thread Brian Volk

> 
> Another guess - maybe the problem is the whitespaces in the printer
> name. Try escaping them using backslashes:
> copy ($source_file, '//HP-EXCH/HP\ LaserJet\ 4100(IS)');
> 
> I would also try changing the single quotes to double quotes.
> 
> Hope this helps,
> -- 
> Offer Kaye
> 

I tried that too.. :~) I'm now working w/ the Net::Printer module and I
think I'm getting closer.  The error I'm getting is below..  Not too sure
what Unknow error means but I'll keep searching.

Thanks for your help.

-- begin

C:\brian\Perl>perl send_to_printer.pl
Use of uninitialized value in sprintf at C:/Perl/site/lib/Net/Printer.pm
line 742.
Couldn't send data: Unknown error at send_to_printer.pl line 39
ERROR:Net::Printer[168]: Error Occured sending data to printer
at send_to_printer.pl line 39
 
#!/usr/local/bin/perl 
 
use strict;
use warnings;
# use File::Copy;
use Net::Printer;
 
my $source_folder = "C:/brian/text_files";
 
my $dest_file = "C:/brian/test/item_file1.txt";
open ITEMFILE, ">$dest_file";
 
opendir(FILES,$source_folder);
my @files_to_process_list = grep {!(/^\./) && -f "$source_folder/$_"} 
readdir(FILES);
closedir (FILES);
 
foreach my $source_file(@files_to_process_list) {
 
print ITEMFILE "$source_file\n";
 
my $lineprinter = new Net::Printer (
 filename=> "C:/brian/test/item_file1.txt",
 printer  => "HP4100-IS",   # this is the Share name
 server   => "HP-EXCH",
 port  => "515"'  
 #lineconvert => "NO"   
  
);
 
 
my $result = $lineprinter->printfile();  
 
} 

-- end
 
Brian Volk

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: Send file to printer

2005-03-24 Thread Bakken, Luke
> > Another guess - maybe the problem is the whitespaces in the printer
> > name. Try escaping them using backslashes:
> > copy ($source_file, '//HP-EXCH/HP\ LaserJet\ 4100(IS)');
> > 
> > I would also try changing the single quotes to double quotes.
> > 
> > Hope this helps,
> > -- 
> > Offer Kaye
> > 
> 
> I tried that too.. :~) I'm now working w/ the Net::Printer 
> module and I
> think I'm getting closer.  The error I'm getting is below..  
> Not too sure
> what Unknow error means but I'll keep searching.
> 
> Thanks for your help.
> 
> -- begin

c:\>net use lpt1: "\\hp-exch\HP LaserJet 4100(IS)" /p:n

Then from the command line:

c:\>copy file_for_printer lpt1:

If that works, then using File::Copy to lpt1: should work as well.

Luke

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Send file to printer

2005-03-24 Thread Brian Volk


>From: Bakken, Luke [mailto:[EMAIL PROTECTED]

> c:\>net use lpt1: "\\hp-exch\HP LaserJet 4100(IS)" /p:n
> 
> Then from the command line:
> 
> c:\>copy file_for_printer lpt1:
> 
> If that works, then using File::Copy to lpt1: should work as well.
> 
> Luke
> 

Thanks Luke!   When I type this at a command line I get "The network
resource type is not correct".

net use lpt1: "\\hp-exch\HP LaserJet 4100(IS)" /p:n 

Any ideas what that means?

Thanks!

Brian 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


RE: Send file to printer

2005-03-29 Thread Brian Volk


> -Original Message-
> From: Brian Volk [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 24, 2005 11:24 AM
> To: 'Bakken, Luke'; 'Perl Beginners'
> Subject: RE: Send file to printer
> 
> 
> 
> 
> >From: Bakken, Luke [mailto:[EMAIL PROTECTED]
> 
> > c:\>net use lpt1: "\\hp-exch\HP LaserJet 4100(IS)" /p:n
> > 
> > Then from the command line:
> > 
> > c:\>copy file_for_printer lpt1:
> > 
> > If that works, then using File::Copy to lpt1: should work as well.
> > 
> > Luke
> > 
> 
> Thanks Luke!   When I type this at a command line I get "The network
> resource type is not correct".
> 
> net use lpt1: "\\hp-exch\HP LaserJet 4100(IS)" /p:n 
> 
> Any ideas what that means?
> 
> Thanks!
> 
> Brian 


Hi All, 

I was able to send the file to the printer using:  copy ($print_file,
'//hp-exch/HP4100-IS'); 
just like the documetation said ..  :~)  I just had to get the server name
correct!

Thanks!

Brian




 
 
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


RE: Send file to printer

2005-03-29 Thread Brian Volk

> 
> Hi All, 
> 
> I was able to send the file to the printer using:  copy 
> ($print_file, '//hp-exch/HP4100-IS'); 
> just like the documentation said ..  :~)  I just had to get 
> the server name correct!
> 
> Thanks!
> 
> Brian
> 
> 
> 


Well, I thought I knew what I was doing.  Now I am having a problem w/ the
carriage return.  When the file prints to the screen, it looks fine..
however, when it prints to the printer, I does not see the carriage return
and only prints the first line.  I have tried inserting "\n" will no luck..
Can someone pls help.

Thanks!

---begin

#!/usr/local/bin/perl 
 
use strict;
use warnings;
use File::Copy;
 
my $print_file = "C:/brian/test/12345.txt";
 open (PRINT, "< $print_file") or die "can't open $print_file : $!";

while(  ) {
   print;

}

copy ($print_file, '//hp-exch/HP4100-IS');

close PRINT;

---end  

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Re: send a HUP signal

2005-07-24 Thread Peter Scott
On Sat, 23 Jul 2005 13:07:51 +0100, Dan wrote:
> i don't even know if this is going to be possible, but i'll ask anyway.
> my perl program runs as a constant process in the background. is there
> anyway i can make another program/script send a HUP, or any kind of, signal
> to the process, to say, force a re-read of a database or something, to get
> it to act on data sent by a user from a website or something. i don't want
> to go to the trouble of trying to build a webserver into the program as
> well, if i can simply send a signal to the program, then get the website to
> enter data into a specific part of a database, then send a signal to the
> process id to get it to (re)read that portion of the database.

Look at the first part of perldoc perlipc.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: send email with Perl

2005-10-27 Thread Bob Showalter
Charles Li wrote:
> Hi,
> I am using "use Net::SMTP;" to send email to multiple
> people.  But the recipients can not send the other
> receiver emails.  It just says undisclosed recipients.
>  How do I send email to multiple people and let them
> see who is on the To list?

Include a To: header in the mail message.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: send email with Perl

2005-10-27 Thread Ryan Frantz


> -Original Message-
> From: Charles Li [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 27, 2005 9:38 AM
> To: beginners@perl.org
> Subject: send email with Perl
> 
> Hi,
> I am using "use Net::SMTP;" to send email to multiple
> people.  But the recipients can not send the other
> receiver emails.  It just says undisclosed recipients.
>  How do I send email to multiple people and let them
> see who is on the To list?

After creating the mail object ($email in this example), you can use the
datasend() method like so:

  my @toList = ( '[EMAIL PROTECTED]', '[EMAIL PROTECTED]' );
  $email->datasend("To: @toList\n");

You may need to join() the list items with a ',' or ';' in order for the
mail client to read/display the names properly.

ry

> 
> Thanks.
> 
> 
> 
> 
> __
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: New on Mail::Send

2005-11-16 Thread Thomas Bätzler
ZHAO, BING <[EMAIL PROTECTED]> presumed:
>   I am on Windows XP home edition. I have this 
> software Secure Shell which tunnels to a remote host(unix). 
> The remote is very strictly managed, any installation of 
> anything would require me to talk to/call up the system 
> administator(this is national security). Then I have this 
> home-made module directory, just a dir with lots of *.pm 
> files, I have got away without actually downloading any 
> module for a while. ( I usually just copy and paste the raw 
> source code and save it under my module dir)

Wow, your sysadmin is gonna love this - they set up all of
those security precautions and some nerd student actually
goes out of his way to bypass them. Way to go!

[...]

> Any CONSTRUCTIVE suggestion on how I should modify my code?

No, but a constructive suggestion on how to improve your
chances of actually getting help: don't insult the people
you want help from.

HTH,
Thomas

PS: A nastier person than me would've notified [EMAIL PROTECTED]
of your antics.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: New on Mail::Send

2005-11-17 Thread Bob Showalter

ZHAO, BING wrote:
> I don't care how the
> perl is developing and where perl is going. I am doing stuff way fancier
> than what you can imagine. I am current doing a project with web input
> and data anaylysis and email feedback.

You're right, that's *way* fancier than I can imagine!

I'll not trifle with you futher. Best wishes.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: New on Mail::Send

2005-11-17 Thread Ryan Frantz


> -Original Message-
> From: ZHAO, BING [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 17, 2005 12:15 AM
> To: Bob Showalter
> Cc: beginners@perl.org
> Subject: New on Mail::Send
> 
>   I am on Windows XP home edition. I have this software
Secure
> Shell which tunnels to
> a remote host(unix). The remote is very strictly managed, any
installation
> of anything would
> require me to talk to/call up the system administator(this is national
> security). Then I have this
> home-made module directory, just a dir with lots of *.pm files, I have
got
> away without actually
> downloading any module for a while. ( I usually just copy and paste
the
> raw source code and save
> it under my module dir)
>   Any 'make install' would result in Error. Since what I
am
> doing is relatively
> simple, I just dug out the required module from the MailTools-1.67/,
like
> Mail::Send, Mail::Mailer
> etc and save them into my secret home-made module dir and set path to
it.
> 
> 
>   STOP: any suggestion for me on how to install modules
> correctly or any doubt for me
> on if I really want to learn to install modules, plz stop. I
appreciate
> your eagerness to show off
> your seniority. And stop making assumption, as I just stated case
clear
> enough. And when it comes
> down to learning/study, very few people could match my intensity.
> 
>   My point again: I am a perl beginner. I don't care how
the
> perl is developing and
> where perl is going. I am doing stuff way fancier than what you can
> imagine. I am current doing a
> project with web input and data anaylysis and email feedback. I need
to do
> them and not to think
> why and how perl is like this, why and how perl module works this way.
As
> long as it works, I am
> happy and I am making progress. If the purpose of being on this list
is to
> ask questions and help
> each other out, I am in for it.
> I have enough 'living-a-pumped-up-life' phylosophies from my
5,000-year
> cultural heritages.

Phew!  Feel better?  Take it easy there fella...

> 
> 
>   Here is my script:
> 
> require Mail::Send;
> $msg = new Mail::Send;
> $msg = new Mail::Send Subject=>'example subject', To=>'Bing Zhao';
> $msg->to('[EMAIL PROTECTED]');
> $msg->subject('example subject');
> $msg->cc('[EMAIL PROTECTED]');
> $fh = $msg->open;
> print $fh "Body of message";
> $fh->close;
> 

The script appears to be OK.  You're issue may not reside with the
script, though.  You should verify that you are able to actually send
mail via your local mail client (from the UNIX box, not the Windows
box).  Mail::Send expects a working mail client (mail, mailx, etc.).  If
you can't send mail, Mail::Send won't be able to either.

Try this from your prompt:

[EMAIL PROTECTED] mail -s "Some Random Subject"
[EMAIL PROTECTED]



Some text for the body...

^D (Control-D)



If this fails to send the email, you have an issue outside of Perl and
Mail::Send.  You can even use the -v switch with mail/mailx to get more
verbose connection information.

ry

> 
> With no error regarding the whereabout of the necessary modules, I
assume
> I got the module thing
> right. Then every time, this 'dead.letter' is generated. I guess it's
part
> of the built-in
> function of Mail::Send, when the script fails to send the email.
Anyway,
> here is a copy of the
> dead.letter files:
> 
>  From bzhao Wed Nov 16 12:13:15 2005
> Return-Path: 
> Received: (from [EMAIL PROTECTED])
> by gly.lbl.gov (8.12.11/8.12.11/Submit) id jAGKDFRT011092;
> Wed, 16 Nov 2005 12:13:15 -0800
> Date: Wed, 16 Nov 2005 12:13:15 -0800
> From: bing zhao 
> Message-Id: <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: example subject
> To: [EMAIL PROTECTED]
> 
> Body of message
> 
> Any CONSTRUCTIVE suggestion on how I should modify my code?
> 
> thanks a lot.
> 
> best,
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Mail::Send and Taint

2005-11-20 Thread Tom Allison

Tom Allison wrote:

I think I just got burned on Mail::Send.
I've been using it for months/years with no problem, but now I'm writing 
a web app and Taint won't let me use Mail::Send


Insecure $ENV{PATH} while running with -T switch at 
/usr/share/perl5/Mail/Mailer/sendmail.pm line 16.



The answer is: Don't use Mail::Send in a secure environment because it's 
trying to send email via local 'sendmail' type applications.
It might be possible to use this with an SMTP type network connection 
but I couldn't find any documentation to that effect.


Mail::Mailer with an SMTP connection works fine.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: for send an email

2005-12-23 Thread Chris Devers
On Sat, 24 Dec 2005, Rafael Morales wrote:

> I need to send an email to some clients, so I need to know if their 
> mail client can accept html format or just text format. How can know 
> that ???, I think that there is, some cpan module to do that however I 
> haven't found it.

The mail sender has no way of knowing what client the recipient will be 
using, or what capabilities it will have. The polite thing is to only 
send plain text email ever, but we lost that fight years ago. 

The next most polite thing is to figure out how to send a multipart 
message with both HTML and plain-text components, so that the mail 
client can decide for itself, at the recipient's preference, whether to 
display the plain or formatted version of the message.

Figuring out how to do this is left as an exercise for the reader.
 
> Could you help me please with this homwork ??? thank you very very 
> much. Regards.
 
Ah, you've found the wrong list. You're looking for

[EMAIL PROTECTED]

Note that it may not exist yet.

Setting it up is left as an exercise for the reader. :-) 


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: for send an email

2005-12-23 Thread Adriano Ferreira
On 12/23/05, Rafael Morales <[EMAIL PROTECTED]> wrote:
> I need to send an email to some clients, so I need to know if their mail 
> client can accept html format or just text format. How can know that ???, I 
> think that there is, some cpan module to do that however I haven't found it.

When you send email, you send it via/to a SMTP server. And then via
PO3/IMAP, they retrieve these messages, making difficult, to say the
least, that you know something about the clients used to read the
received messages. I think you need to get this information directly
from your clients -- even if extracted automatically. That is, if you
have a way to make them send a message to you, the message headers
usually contain the mail client identification - which can be mapped
to the probably acceptable formats. (Well, if they change clients,
that information goes outdated.)

Regards,
Adriano.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: for send an email

2005-12-26 Thread tee

Sometimes your responses just crack me up, Chris !

Chris Devers wrote:


On Sat, 24 Dec 2005, Rafael Morales wrote:

 

I need to send an email to some clients, so I need to know if their 
mail client can accept html format or just text format. How can know 
that ???, I think that there is, some cpan module to do that however I 
haven't found it.
   



The mail sender has no way of knowing what client the recipient will be 
using, or what capabilities it will have. The polite thing is to only 
send plain text email ever, but we lost that fight years ago. 

The next most polite thing is to figure out how to send a multipart 
message with both HTML and plain-text components, so that the mail 
client can decide for itself, at the recipient's preference, whether to 
display the plain or formatted version of the message.


Figuring out how to do this is left as an exercise for the reader.

 

Could you help me please with this homwork ??? thank you very very 
much. Regards.
   



Ah, you've found the wrong list. You're looking for

[EMAIL PROTECTED]

Note that it may not exist yet.

Setting it up is left as an exercise for the reader. :-) 



 



RE: how do send keys

2002-09-05 Thread Timothy Johnson


If you're using a Win32 platform, I'd look for Win32::SetupSup.

-Original Message-
From: Tyler, Grayling [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: how do send keys


How do I start a program in perl and send keystrokes to it??


thanks


This electronic message may contain confidential or privileged information 
and is intended for the individual or entity named above.  If you are 
not the intended recipient, be aware that any disclosure, copying, 
distribution or use of the contents of this information is prohibited. 
If you have received this electronic transmission in error, please notify 
the sender immediately by using the e-mail address or by telephone
(704-633-8250). 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: how do send keys

2002-09-05 Thread John W. Krahn

Grayling Tyler wrote:
> 
> How do I start a program in perl and send keystrokes to it??


perldoc -f open
perldoc perlopentut
perldoc Expect
perldoc IPC::Open2
perldoc IPC::Open3


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Send mail through local sendmail

2002-12-04 Thread Stelian Iancu
Hello!

I have this cgi script and I want to send mail to the users using the
local installed sendmail. Can you please explain how to do it? Or please
point me to a doc that explains this? 

-- 
Regards,
Stelian I.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Don't Send To Me!

2003-11-24 Thread Randal L. Schwartz
>>>>> "Jason" == Jason Dusek <[EMAIL PROTECTED]> writes:

Jason> Is there some way to get people on this list to stop sending me two
Jason> emails at once?  I am on the beginner's list - so when you send email
Jason> to me and then cc to the list, I get two.  Which is annoying.  I
Jason> suppose I could write some rules to kill duplicate messages, but I
Jason> have got stuff to do.  If I post to the list, I think it may be safely
Jason> assumed that I will read it to find out what people have to say about
Jason> my posting.

If you have procmail delivery, this rule works nicely:

  :0 Wh: msgid.lock
  | formail -D 8192 msgid.cache

Right from procmailex(1).

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Don't Send To Me!

2003-11-24 Thread Daniel Staal
--As off Monday, November 24, 2003 12:54 AM -0600, Jason Dusek is 
alleged to have said:

Is there some way to get people on this list to stop sending me two
emails at once?  I am on the beginner's list - so when you send
email to me and then cc to the list, I get two.  Which is annoying.
I suppose I could write some rules to kill duplicate messages, but
I have got stuff to do.  If I post to the list, I think it may be
safely assumed that I will read it to find out what people have to
say about my posting.
--As for the rest, it is mine.

My solution has been to change my reply-to address to the list. 
(Since that is what I want people to do, reply to the list.)

It looks like there should be a way to do this in Apple's Mail app. 
There is manually at least, so I bet you could AppleScript it.

Daniel T. Staal

---
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Don't Send To Me!

2003-11-24 Thread drieux
On Monday, Nov 24, 2003, at 09:10 US/Pacific, Daniel Staal wrote:
[..]
It looks like there should be a way to do this in Apple's Mail app.
There is manually at least, so I bet you could AppleScript it.
Daniel T. Staal
p0: the Apple Mail.app trick is
Edit-> add reply header
fill in with the beginner's mailing list
p1: there is also a cultural issue here as well,
since for some 'replying directly' to a person
who has asked a question, and then cc-ing the
list, makes sure that the 'response gets back'
to the original person. The idea is that this
is 'more personal' and does not require that the
asker 'search' for the response on the list with
a threaded mail application.
p2: One's mileage really varies on these things.
For some folks, it is easier to do a 'reply all'
so that both the persons in 'the thread' as well
as the list have a copy of the email. The upside
of which is that one doesn't inadvertantly misdirect
email between various mailing list when one selects
from their automated list of possible email addresses.
ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Don't Send To Me!

2003-11-24 Thread Jason Dusek
On Monday, November 24, 2003, at 02:21  AM, Randal L. Schwartz wrote:

If you have procmail delivery, this rule works nicely:

  :0 Wh: msgid.lock
  | formail -D 8192 msgid.cache
Right from procmailex(1).
I am just going to use the 'Reply-To' header in Mail.app and see if it 
works.

- Jason

When Banzan was walking through the Union Square greenmarket
he overheard a conversation between a vendor and his customer.
"Do you have chocolate mousse?" asked the customer.
"We have chocolate pudding," replied the vendor.
At these words Banzan became enlightened.
-Mike Topp

Re: Send in POST method

2003-12-04 Thread Casey West
Hi.

I'm in the employ of Casey West, a list admin, to assist you with your
question. I've taken the liberty to search Google using the Subject line
you provided in your email to the list. I hope one of the links below
will be of service to you.

Sadly Google hasn't given us a nice, legal API for searching newsgroups,
so you may also want to try these searches.

 http://groups.google.com/groups?q=Perl+Send+POST+method
 http://groups.google.com/groups?q=Send+POST+method+group%3Acomp.lang.perl.*

If you didn't get any useful results below, there's a chance your
Subject line was not specific enough, or not detailed enough. For
example, the following subject lines are not very good choices.

  Subject: Doubt
  Subject: HELP!
  Subject: Problem

On the other hand, it's possible that your question is unique, or the
search needs a human touch to get just the right results.

Enjoy!

Perl.org Beginners' Lists, 0 results.
  Searched: site:nntp.x.perl.org inurl:perl.beginners -inurl:show_headers Send POST 
method

Perl.org Lists, 10 results.
  Searched: site:nntp.x.perl.org -inurl:show_headers Send POST method

  [1] nntp.perl.org - perl.cpan.testers (79633)
   http://nntp.x.perl.org/group/perl.cpan.testers/79633
 ... f make request even if head believes method is illegal ... use
 this content-type for POST, PUT, CHECKIN ... proxy settings from
 environment -H  send this HTTP ...

  [2] nntp.perl.org - perl.perl6.announce (347)
   http://nntp.x.perl.org/group/perl.perl6.announce/347
 ... by answering each question in a separate post with a ... to
 multiple dispatch there were no such method to find. ... or more
     of the following options: * Send money to ...

  [3] nntp.perl.org - perl.modules (14951)
   http://nntp.x.perl.org/group/perl.modules/14951
 ... you start with Method # 1 and add METHOD # 2 as ... Remember
 though, the more you send out the more potential ... surprised
 when I found my medium size post office box ...

  [4] nntp.perl.org - perl.perl6.announce (328)
   http://nntp.x.perl.org/group/perl.perl6.announce/328
 ... most stuff from Schwern's cursor his post is worth ... is
 negotiable." and noted that he counted method dispatch under ...
 Because you asked us to send you our answers ...

  [5] nntp.perl.org - perl.perl6.announce (325)
   http://nntp.x.perl.org/group/perl.perl6.announce/325
 ... method { ... ... But so far everybody has ignored that post...
 ... If you did like it, please consider one or both of the
 following options: * Send money to the Perl ...

  [6] nntp.perl.org - perl.libwww (5126)
   http://nntp.x.perl.org/group/perl.libwww/5126
 ... is given: http://somesite.com/prog/adduser";
 method="post">   Female
  http://nntp.x.perl.org/group/perl.cvs.p5ee/366
 ... target_widget = $context->widget($target_wname);
     $target_widget->$method(@args); } my ... So we have to send a
 hidden ... behavior that browsers will post values # in ...

  [8] nntp.perl.org - perl.perl6.announce (349)
   http://nntp.x.perl.org/group/perl.perl6.announce/349
 ... In a subsequent post he noted that it seems ... Quite what's
 wrong with class Object { method CLONE returns ... one or more of
 the following options: * Send money to ...

  [9] nntp.perl.org - perl.mvs (1190)
   http://nntp.x.perl.org/group/perl.mvs/1190
 ... Form >  > Upload Form >
  enctype="multipart ...
 I'm trying to send images to the ...

  [10] nntp.perl.org - perl.perl5.summary (15)
   http://nntp.x.perl.org/group/perl.perl5.summary/15
 ... adds also that every related message she'll send to p5p ...
 was the consequence of this first post, where we learned why a
 specific comparison method is needed ...

search.cpan.org, 10 results.
  Searched: site:search.cpan.org Send POST method

  [1] search.cpan.org: Net::POP3 - Post Office Protocol 3 Client class ...
   http://search.cpan.org/search?module=Net::POP3
 ... Net::POP3 - Post Office Protocol 3 Client class (RFC1939 ...
     When a method states that it returns a value, failure will be
 returned as undef or ... Send the USER command ...

  [2]   Version: 2.011 Date: 2000/06/17 ...
   http://search.cpan.org/src/KWILLIAMS/Apache-AuthCookie-2.011/Changes
 ... directive "{YourAuth}Secure" which will secure
 cookies (ie only send them over ... 02/11 04:46:59 The login forms
 may now use the POST method instead of ...

  [3] search.cpan.org: LWP - The World-Wide Web library for Perl
   http://search.cpan.org/perldoc?LWP
 ... For instance, we will send HTTP::Request s both to ftp ... The
 method is a short string that tells what kind of ... T

script to send email message

2003-03-25 Thread mel awaisi
Hi,

I have been researching on this. i got a script when i try to run get an 
error connecting to server. This script i am just trying to get to work, but 
the main reason for this is to be able to insert it into another Perl script 
where i would like email to be sent automatically when the other part of the 
script does something!

[EMAIL PROTECTED] cgi-bin]# perl email.pl
Content-type: text/plain
Couldn't connect to server at email.pl line 22.
[EMAIL PROTECTED] cgi-bin]#
Regards,

Mel

-email.pl

#!/usr/local/bin/perl

use Net::SMTP;

print "Content-type: text/plain", "\n\n";

my $DEBUG = 1;

if($DEBUG)
{
  $| = 1;
  open(STDERR, ">&STDOUT");
}
# Set this variable to your smtp server name
my $ServerName = "smtp.134.36.16.12";
# Create a new SMTP object
$smtp = Net::SMTP->new($ServerName, Debug => 1);
# If you can't connect, don't proceed with the rest of the script
die "Couldn't connect to server" unless $smtp;
# Initiate the mail transaction
# Your "real" email address
my $MailFrom = "[EMAIL PROTECTED]";
# Recipient's "real" email address
my $MailTo = "[EMAIL PROTECTED]";
$smtp->mail( $MailFrom );
$smtp->to( $MailTo );
# Start the mail
$smtp->data();
# Send the header
# This address will appear in the message
$smtp->datasend("To:  [EMAIL PROTECTED]");
# So will this one
$smtp->datasend("From:  [EMAIL PROTECTED]");
$smtp->datasend("Subject: Test Message\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Hello World!\n\n");
# Send the termination string
$smtp->dataend();
# Close the connection
$smtp->quit();
_
On the move? Get Hotmail on your mobile phone 
http://www.msn.co.uk/msnmobile/mobilehotmail

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


send die "" to a file

2008-09-25 Thread aa aa

Hi,
 
I try to open several files, if one of them failed, my program will die and 
then send the died information to a file. 
 
eg. 
open(AA, "a.txt") or die "can't open file a.txt\n";
 
But I want to this string "can't open file a.txt\n" print to a file. 
 
Is anyone can help me?
 
org.chen
_
Are you paid what you're worth? Find out: SEEK Salary Centre
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2Fcareer%2Dresources%2Fsalary%2Dcentre%2F%3Ftracking%3Dsk%3Ahet%3Asc%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_salary&_m=EXT

Re: Send Mail with attachment

2008-10-22 Thread Jeff Pang
2008/10/22  <[EMAIL PROTECTED]>:
> Hi All,
>
> I'm using perl module MIME::Lite to sent out email with attachments,
> may I know what "Type" should I define to attach any type of files,
> for instance .jpg, .xls, .doc, .pdf  and etc without checking the
> attached file type. Is there any global variable to define instead of
> Type => 'application/zip', Type => 'image/gif', Type => "application/
> xls" and etc?

I don't think there is one.
If you don't specify the types distinctly, you break the rules (RFC 2822 etc).

-- 
my @name = glob "{JeffP}{a,e}{ng}"
http://home.arcor.de/pangj/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Send Mail with attachment

2008-10-22 Thread Octavian Rasnita
From: <[EMAIL PROTECTED]>
> Hi All,
> 
> I'm using perl module MIME::Lite to sent out email with attachments,
> may I know what "Type" should I define to attach any type of files,
> for instance .jpg, .xls, .doc, .pdf  and etc without checking the
> attached file type. Is there any global variable to define instead of
> Type => 'application/zip', Type => 'image/gif', Type => "application/
> xls" and etc?

You could use
Mail::Builder
to create the mail messages and and Email::Send to send them.

You should use something like:

use strict;
use warnings;
use Mail::Builder;
use Email::Send;

my $mail = Mail::Builder->new;
$mail->from('[EMAIL PROTECTED]');
$mail->to('[EMAIL PROTECTED]');
$mail->subject('Here is the subject');
$mail->plaintext('The plain text version');
$mail->htmltext('The html version');
$mail->attachment->add('file.pdf');
$mail->attachment->add('anotherfile.pdf');
$mail->image->add(image.jpg'); #An image you want to appear in the html file

my $mailer = Email::Send->new({mailer => 'SMTP'});
$mailer->mailer_args([Host => 'smtp.yourhost.com']);
$mailer->send($mail->stringify);

This module also encodes the headers as UTF-8, so they will be set correctly if 
the headers use special chars from other languages than english.
HTH.

Octavian


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




RE: Send Mail with attachment

2008-10-22 Thread Stewart Anderson
> 
> Hi All,
> 
> I'm using perl module MIME::Lite to sent out email with attachments,
> may I know what "Type" should I define to attach any type of files,
> for instance .jpg, .xls, .doc, .pdf  and etc without checking the
> attached file type. Is there any global variable to define instead of
> Type => 'application/zip', Type => 'image/gif', Type => "application/
> xls" and etc?
> 
>   $msg->attach (
>  Type => 'what type should I define without checking the
attached
> file type',
>  Path => '$path',
>  Filename => '$filename',
>  Disposition => 'attachment'
>   )
> 
> Please helps.
> 
I think  that  with MIME::Lite you can  just set the  type as BINARY or
TEXT.  I experimented with  lots of   types  for  zip files and xls/csv
files and whilst  is  may break the RFC  it  does not seem to break how
the item is attached  eg I send  xls files as text and  it made no
difference  when  the mail arrived in outlook with the attachement.

That's  probably heresy though :)

Stu



Information in this email including any attachments may be privileged, 
confidential and is intended exclusively for the addressee. The views expressed 
may not be official policy, but the personal views of the originator. If you 
have received it in error, please notify the sender by return e-mail and delete 
it from your system. You should not reproduce, distribute, store, retransmit, 
use or disclose its contents to anyone. Please note we reserve the right to 
monitor all e-mail communication through our internal and external networks. 
SKY and the SKY marks are trade marks of British Sky Broadcasting Group plc and 
are used under licence. British Sky Broadcasting Limited (Registration No. 
2906991), Sky Interactive Limited (Registration No. 3554332), Sky-In-Home 
Service Limited (Registration No. 2067075) and Sky Subscribers Services Limited 
(Registration No. 2340150) are direct or indirect subsidiaries of British Sky 
Broadcasting Group plc (Registration No. 2247735). All of the companies 
mentioned in this paragraph are incorporated in England and Wales and share the 
same registered office at Grant Way, Isleworth, Middlesex TW7 5QD.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Send email using smtp

2009-01-05 Thread Octavian Rasnita

From: "Fúlvio" 
Hi all,

I am trying to send an email using the following code:

use Net::SMTP;

$smtp = Net::SMTP->new("smtp.yahoo.com");
$smtp->mail('fulviocg');

but the error below is happening:

Can't call method "mail" on an undefined value at 

Can someone help me?

Hi,

Can you use Yahoo's SMTP server?
I thought that they don't allow this.

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-05 Thread Jenda Krynicky
From: Fúlvio 
> Hi all,
>
> I am trying to send an email using the following code:
>
> use Net::SMTP;
>
> $smtp = Net::SMTP->new("smtp.yahoo.com");
> $smtp->mail('fulviocg');
>
> but the error below is happening:
>
> Can't call method "mail" on an undefined value at 

Apparently the Net::SMTP->new() failed to create the object. Most
likely it was unable to connect to smtp.yahoo.com. Find out how to
ask Net::SMTP what's wrong with creating the object and do test
whether you obtained one or not.

Actually ... it looks like you'd have to dive way below the surface
to find out how the heck to get any error information from Net::SMTP.
According to Net::Cmd's docs you may get some info by $smtp-
>message(), ->code(), ->ok() and ->status(), but the constructor
seems to give you zero information. Unless you enable debugging and
somehow catch whatever the module (or some of it's superclasses)
prints to STDERR.

You might have better luck with a different module. Mail::Sender or
MIME::Lite or Mail::Sendmail come to mind.

Jenda

= je...@krynicky.cz === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-05 Thread Rob Dixon
Fúlvio wrote:
> 
> I am trying to send an email using the following code:
> 
> use Net::SMTP;
> 
> $smtp = Net::SMTP->new("smtp.yahoo.com");
> $smtp->mail('fulviocg');
> 
> but the error below is happening:
> 
> Can't call method "mail" on an undefined value at 
> 
> Can someone help me?

The documentation for Net::SMTP says this

> This documentation assumes that you are familiar with the concepts of the 
> SMTP protocol described in RFC821

and it is important to understand that what you are trying to do isn't trivial.

If, however, you are au fait with SMTP then I suggest you will get better
results using the correct SMTP address 'smtp.mail.yahoo.com'.

HTH,

Rob

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-06 Thread Fúlvio Figueirôa
Hi Rob,
Thanks for your answer.

I change the code to try debug and put the correct SMTP address:

$smtp_test = Net::SMTP->new('smtp.mail.yahoo.com',
Timeout => 30,
Debug => 1,)|| print "ERROR creating SMTP obj: $! \n";

but the following message is displayed: "Bad file descriptor".

I don't need to use the SMTP procotol, I need only send an email.

Thanks,

Fúlvio


On Mon, Jan 5, 2009 at 7:47 PM, Rob Dixon  wrote:

> Fúlvio wrote:
> >
> > I am trying to send an email using the following code:
> >
> > use Net::SMTP;
> >
> > $smtp = Net::SMTP->new("smtp.yahoo.com");
> > $smtp->mail('fulviocg');
> >
> > but the error below is happening:
> >
> > Can't call method "mail" on an undefined value at 
> >
> > Can someone help me?
>
> The documentation for Net::SMTP says this
>
> > This documentation assumes that you are familiar with the concepts of the
> > SMTP protocol described in RFC821
>
> and it is important to understand that what you are trying to do isn't
> trivial.
>
> If, however, you are au fait with SMTP then I suggest you will get better
> results using the correct SMTP address 'smtp.mail.yahoo.com'.
>
> HTH,
>
> Rob
>


Re: Send email using smtp

2009-01-06 Thread Fúlvio
Hi Jenda,

I try to debug the code and the error message was: "Bad file
descriptor".
I will try to use the other modules.
I need only send an email.

Thanks,

Fúlvio



On 5 jan, 17:46, je...@krynicky.cz (Jenda Krynicky) wrote:
> From: Fúlvio 
>
> > Hi all,
>
> > I am trying to send an email using the following code:
>
> > use Net::SMTP;
>
> > $smtp = Net::SMTP->new("smtp.yahoo.com");
> > $smtp->mail('fulviocg');
>
> > but the error below is happening:
>
> > Can't call method "mail" on an undefined value at 
>
> Apparently the Net::SMTP->new() failed to create the object. Most
> likely it was unable to connect to smtp.yahoo.com. Find out how to
> ask Net::SMTP what's wrong with creating the object and do test
> whether you obtained one or not.
>
> Actually ... it looks like you'd have to dive way below the surface
> to find out how the heck to get any error information from Net::SMTP.
> According to Net::Cmd's docs you may get some info by $smtp->message(), 
> ->code(), ->ok() and ->status(), but the constructor
>
> seems to give you zero information. Unless you enable debugging and
> somehow catch whatever the module (or some of it's superclasses)
> prints to STDERR.
>
> You might have better luck with a different module. Mail::Sender or
> MIME::Lite or Mail::Sendmail come to mind.
>
> Jenda
>
> = je...@krynicky.cz ===http://Jenda.Krynicky.cz=
> When it comes to wine, women and song, wizards are allowed
> to get drunk and croon as much as they like.
>         -- Terry Pratchett in Sourcery


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-06 Thread Fúlvio
Hi Octavian,

I don't need to use this server. I need only to send an email, but as
I don't know perl
very well I get an example using SMTP and yahoo server.

Thanks,

Fúlvio

On 5 jan, 17:16, orasn...@gmail.com (Octavian Rasnita) wrote:
> From: "Fúlvio" 
> Hi all,
>
> I am trying to send an email using the following code:
>
> use Net::SMTP;
>
> $smtp = Net::SMTP->new("smtp.yahoo.com");
> $smtp->mail('fulviocg');
>
> but the error below is happening:
>
> Can't call method "mail" on an undefined value at 
>
> Can someone help me?
>
> Hi,
>
> Can you use Yahoo's SMTP server?
> I thought that they don't allow this.
>
> Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-06 Thread Octavian Rasnita
From: "Fúlvio" 
> Hi Octavian,
> 
> I don't need to use this server. I need only to send an email, but as
> I don't know perl
> very well I get an example using SMTP and yahoo server.

You can't send an email without using an SMTP server, or sendmail, qmail...
Do you use an SMTP server for sending email with your email client (Outlook 
Express, Outlook, Eudora or another client...)?
Or do you have a Gmail account that you can use for sending email?

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-06 Thread Ralf Peng
2009/1/6 Fúlvio :
> Hi Jenda,
>
> I try to debug the code and the error message was: "Bad file
> descriptor".
> I will try to use the other modules.
> I need only send an email.
>

If you are not familiar with SMTP protocal (RFC 821), you are hard to
use Net::SMTP.
I'd suggest you use another module which may encapsulate Net::SMTP.
There are a lot of that modules on CPAN, like Mail::Send, Email::Send,
Mail::Sender,Mail::Lite etc.
Just pick up one you best like.

Ralf.


Re: Send email using smtp

2009-01-06 Thread Gunnar Hjalmarsson

Fúlvio Figueirôa wrote:

I don't need to use the SMTP procotol,


Well, you *do* need an SMTP server that you are allowed to use.


I need only send an email.


This is an example that makes use of my favorite module Mail::Sender 
(written by Jenda, btw):


use Mail::Sender;

ref (new Mail::Sender -> MailMsg( {
smtp  => 'localhost',
from  => 'm...@example.com',
to=> 'y...@example.com',
subject   => 'Test',
msg   => 'This is just a test message...',
} )) or die "Cannot send mail. $Mail::Sender::Error\n";

Stating 'localhost' as the SMTP server works on the box where I am, as 
is the case on many other platforms. Otherwise you need to state the 
actual host name of the SMTP server.


--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-06 Thread Octavian Rasnita

From: "Fúlvio Figueirôa" 

Hi Octavian,
I solved my problem using sendmail with the code below:

open (MAIL, "|/usr/sbin/sendmail -t ");
print MAIL "From: someaddr...@somedomain\n";
print MAIL "To: someaddre...@somedomain\n";
print MAIL "Content-Type: text/plain\n";
print MAIL "Subject: Very simple email test\n\n";
print MAIL "Body of the message";
close (MAIL);


If you can use sendmail and if you also need to send email messages with 
attachments or html emails eventually with inline images (and for more other 
features), you can use Mail::Builder::Simple.
(You can also use it for sending email with an SMTP server, or with Gmail, 
sendmail, qmail...)


Here is an example for sending a plaintext message:

use Mail::Builder::Simple;

my $mail = Mail::Builder::Simple->new;

$mail->send(
 from => 'm...@host.com',
 to => 'y...@yourhost.com',
 subject => 'The subject with UTF-8 chars',
 plaintext => "Hello,\n\nHow are you?\n",
);

If you want to also send an html part an an attachment, you will need to 
add:


htmltext => 'HelloHere is a test message.',
attachment => 'file.pdf',

This module allows sending UTF-8 encoded messages (body and headers) without 
needing to do the encoding manually.


http://search.cpan.org/author/TEDDY/Mail-Builder-Simple-0.02/lib/Mail/Builder/Simple.pm

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Send email using smtp

2009-01-06 Thread Fúlvio Figueirôa
Hi Octavian,
I solved my problem using sendmail with the code below:

open (MAIL, "|/usr/sbin/sendmail -t ");
print MAIL "From: someaddr...@somedomain\n";
print MAIL "To: someaddre...@somedomain\n";
print MAIL "Content-Type: text/plain\n";
print MAIL "Subject: Very simple email test\n\n";
print MAIL "Body of the message";
close (MAIL);

Thanks for your help.

Fúlvio

On Tue, Jan 6, 2009 at 10:48 AM, Octavian Rasnita wrote:

> From: "Fúlvio" 
> > Hi Octavian,
> >
> > I don't need to use this server. I need only to send an email, but as
> > I don't know perl
> > very well I get an example using SMTP and yahoo server.
>
> You can't send an email without using an SMTP server, or sendmail, qmail...
> Do you use an SMTP server for sending email with your email client (Outlook
> Express, Outlook, Eudora or another client...)?
> Or do you have a Gmail account that you can use for sending email?
>
> Octavian
>
>


Re: Send email using smtp

2009-01-06 Thread Steve Bertrand
Fúlvio Figueirôa wrote:
> Hi Octavian,
> I solved my problem using sendmail with the code below:
> 
> open (MAIL, "|/usr/sbin/sendmail -t ");
> print MAIL "From: someaddr...@somedomain\n";
> print MAIL "To: someaddre...@somedomain\n";
> print MAIL "Content-Type: text/plain\n";
> print MAIL "Subject: Very simple email test\n\n";
> print MAIL "Body of the message";
> close (MAIL);

I've had issues with doing things this way in the past. From my
experience with the above code, if there is a fault, the message will
not be sent, nor will it be queued to be sent later. Depending on the
situation, not having the program follow proper SMTP protocol could be a
problem if a message is not delivered, and there is no trace of it in
any queue.

Perhaps someone here can verify that there is a workaround, but I would
highly recommend at least handing off the message so that a proper MTA
can take care of any network-type issues for you, even if the MTA is on
the localhost.

My past experience was with receipts... clients would, from time to
time, not receive receipts from a Perl-based receipt mailer.

I guess, if anything, instead of a file handle directly to MAIL (per
above), one could write to file, then mail it, but there are certainly
better ways to interact directly to a proper MTA.

Steve

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




  1   2   3   4   5   >