Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

e-mail

Status
Not open for further replies.

nappaji

Programmer
Mar 21, 2001
76
US
How do I CC a person/people a mail which I send?? What if I have to retrieve the email addresses from text boxes??

$sender = 'abc@abc.com'
$recipient = 'xyz@abc.com'

print MAIL "From: $sender\n";

print MAIL "To: $recipient\n";

if I have to send the same mail to more than one person than abc, how do I do it??
I have 2 textbox fields where the email addresses are entered.

I tried.

$sender = 'xyz@abc.com, $query->param('txtEmail1'), $query->param('txtEmail2') '

but it gave me an error.

Thanks

Thanks
 
you should loop through the emails entered and send each one an email.
youcan do it in two ways:
1) name the textboxes with the same name but with a different number at then (e.g. email1, email2 ,email3 etc...)

2) make a textarea box and use \n to as a delimiter.

i prefer the second way but both will do fine. what you do is this:

first example:
Code:
$fields = 2;
for (i = 1; $i <= $fields; $i++) {
  $email = $query->param(&quot;email$i&quot;);
  and do all the rest of the email sending stuff
  or even better, make a sub that will do it for you
}

second example:
Code:
$emails = $query->('emails');

foreach (split &quot;\n&quot;, $emails) {
   $email = $_;
   same stuff as above...
}

:)
 
You could also try:
Code:
print MAIL &quot;Cc: $copy_addresses\n&quot;;
You can use Bcc: too, to send blind carbon copies. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top