in reply to Re: Envia E-mail Sendmail
in thread Send Mail

OK !
I could rewrite my function ?
#!/usr/bin/perl use strict; use warnings; use Mail::Sender; our $sender = new Mail::Sender {smtp => 'smtp.yourdomain.com', from => + 'your.address@yourdomain.com'}; sub EnviaEmail { my ($mail, $subject, $msg, $file) = @_; $sender->MailFile({to => '$mail', subject => '[$subject]', msg +=> "\n$msg\n", file => '$file'}); return; } ...

Replies are listed 'Best First'.
Re: Re: Re: Envia E-mail Sendmail
by Jenda (Abbot) on Aug 07, 2003 at 13:45 UTC

    Watch your quotes! :-) First of ... variables are not interpolated in singlequotes. Therefore instead of the '[$subject]' you should have used "[$subject]". Second you should not enclose variables in quotes unless you need to add something to them. Therefore the '$mail' should not be "$mail" but just $mail.

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature