On 5/11/02 7:56 PM, Bill Lyles <[EMAIL PROTECTED]> wrote:

> Ok here is the mail script
> Please note that the variables are taken from a form
> This line is at the top
> use Net::SMTP;
> 
> these are the variables
> $adminmail = 'q^webmaster2\@adelphia.net^';

Assuming your email address is "q^webmaster2\@adelphia.net^", this is
alright. Otherwise it looks like you're mixing quoting styles, and
needlessly escaping things. I'd suggest:

$adminmail = '[EMAIL PROTECTED]';

> $fname = $field{'fname'} ;
> $lname = $field{'lname'} ;
> $address = $field{'address'} ;
> $city = $field{'city'} ;
> $state = $field{'state'} ;
> $zip = $field{'zip'} ;
> $phone = $field{'phone'} ;
> $email = $field{'email'} ;
> $yes = $field{'yes'} ;
> $no = $field{'no'} ;
> 
> 
> $recip = $email ;

Why not just forget about $email and assign $recip to $field{'phone'}, or
use $email instead of $recip in the following lines?

> my $MAIL = new Net::SMTP('mail.dc3.adelphia.net');
> $MAIL->mail('$adminmail');
> $MAIL->to('$recip');

Single quotes to do interpolate.

$MAIL->to($recip);

or

$MAIL->to("$recip");

This applies to all the other lines as well. Single quotes do not
interpolate, double-quotes do.

> $MAIL->data();
> $MAIL->datasend('To: $email'."\n");
> <snip>
> $MAIL->dataend();
> $MAIL->quit;

Be sure to change the stuff down here, too, to allow the values of the
variables you're using to interpolated.

$MAIL->datasend("To: $email\n");

instead of

$MAIL->datasend('To: $email'."\n");

and so on.

> Will this work

Yes, it will work. As to whether it will work in the manner you expect, you
should correct the syntax and find out. The best way to check if something
works is to test it :)

The overall structure seems to be correct, though.

> and if so, how do I add a CC to myself?

to(), cc(), and bcc() are all synonyms for recipient(). According to the
Net::SMTP docs, a separate server request is sent for each recipient, so you
should just be able to add your email to recipient list. I.e.,

$MAIL->to($recip,$adminmail);

hth,
-- 
Michael


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

Reply via email to