Re: sendmail, etc.

2005-09-09 Thread Bob Showalter

Matthew Sacks wrote:

Greetings,
I want to send mail from my perl code. (Boy, that's
really unusual)

I am thinking using mail::mailer.
I need a bit more info than what I have so far found
in the online documentation  (perldoc -q mail).

Where I can I find some advice?
E.G., there is always an example of code that defines
a $to argument.  but can $to be a list of addresses?
(a group, that is).  Can $to be a list of 100 email
addresses?


I usually use Mail::Send, which is a friendlier wrapper around Mail::Mailer 
(both are part of MailTools distribution).


For Mail::Mailer, $to can be either a single address in a scalar, or a 
reference to an array of addresses:


  To => '[EMAIL PROTECTED]';

  To => [ '[EMAIL PROTECTED]', '[EMAIL PROTECTED]' ];

  To => [EMAIL PROTECTED];

For Mail::Send, you can pass a list to the 'to' method:

  $msg->to(@addrlist);



Do I have to think about tuning my sendmail daemon?


Not for Perl's sake.


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




Re: sendmail, etc.

2005-09-09 Thread Wiggins d'Anconia
zentara wrote:
> On Thu, 8 Sep 2005 19:31:11 -0700 (PDT), [EMAIL PROTECTED]
> (Matthew Sacks) wrote:
> 
> 
>>Greetings,
>>I want to send mail from my perl code. (Boy, that's
>>really unusual)
>>
>>I am thinking using mail::mailer.
>>I need a bit more info than what I have so far found
>>in the online documentation  (perldoc -q mail).
>>
>>Where I can I find some advice?
>>E.G., there is always an example of code that defines
>>a $to argument.  but can $to be a list of addresses?
>>(a group, that is).  Can $to be a list of 100 email
>>addresses?
>>
>>Do I have to think about tuning my sendmail daemon? 
>>It is starting automatically upon boot, of course
>>
>>-matthew sacks
>>Peace Corps Volunteer
>>[EMAIL PROTECTED]
>>
> 
> 
> This is untested, and there may be a more efficient way, like
> not opening and closing SENDMAIL each time thru the loop.
> But this should work.
>

Ugh, stick with a module. Dealing with sendmail directly is a giant
hassle, formatting complex messages by hand is an even bigger hassle.
Enhancing the code to send attachments which is almost always the next
question is one that should never be answered. This is a wheel that has
been re-invented enough.

The code that was below *may* have been sufficient but it doesn't have
proper error handling and isn't as portable as using most of the mail
modules available on CPAN.

http://danconia.org

> Just take the following snippet, and loop thru it for
> each value of @to.
> 

[snip code, use a module]

> 
> 

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




Re: sendmail, etc.

2005-09-09 Thread Ranish
On Friday 09 September 2005 08:01, Matthew Sacks wrote:
> Greetings,
> I want to send mail from my perl code. (Boy, that's
> really unusual)
>
> I am thinking using mail::mailer.
> I need a bit more info than what I have so far found
> in the online documentation  (perldoc -q mail).
>
> Where I can I find some advice?
> E.G., there is always an example of code that defines
> a $to argument.  but can $to be a list of addresses?
> (a group, that is).  Can $to be a list of 100 email
> addresses?
>
> Do I have to think about tuning my sendmail daemon?
> It is starting automatically upon boot, of course
>
Hello,

Please try using the perl module Mail::Sendmail which is a nice one.

Ranish

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




Re: sendmail, etc.

2005-09-08 Thread Chris Devers
On Thu, 8 Sep 2005, Matthew Sacks wrote:

> Where I can I find some advice?

This list isn't a bad place to start.

> E.G., there is always an example of code that defines
> a $to argument.  but can $to be a list of addresses?
> (a group, that is).  Can $to be a list of 100 email
> addresses?

In general, yeah, sure. Try it and see for yourself! :-)

The other approach would be to wrap the mail-sending code in a loop, so 
that you'd do, in pseudocode...

foreach $addr ( @addresses ) {
   send_message_to( $addr );
}

But in general, you should also be able to do something like

send_message_to( @addresses )

where, of course, send_message_to() is an exercise for the reader :-)

> Do I have to think about tuning my sendmail daemon? 

Maybe, but I wouldn't worry about that unless you notice problems.



-- 
Chris Devers

®…Vs>AíEÖZ

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


sendmail, etc.

2005-09-08 Thread Matthew Sacks
Greetings,
I want to send mail from my perl code. (Boy, that's
really unusual)

I am thinking using mail::mailer.
I need a bit more info than what I have so far found
in the online documentation  (perldoc -q mail).

Where I can I find some advice?
E.G., there is always an example of code that defines
a $to argument.  but can $to be a list of addresses?
(a group, that is).  Can $to be a list of 100 email
addresses?

Do I have to think about tuning my sendmail daemon? 
It is starting automatically upon boot, of course

-matthew sacks
Peace Corps Volunteer
[EMAIL PROTECTED]



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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