watts Posted September 28, 2006 Share Posted September 28, 2006 Hi,I'm working on a page where you can email yourself a bunch of images that you selected and put in a lightbox (kind of like a shopping cart but no checkout). I have that part working fine using phpMailer but I want it to also send an email to the administrator with the person's email adress and a list of the image numbers they selected. I don't want to BCC because I don't want to send the actual images (like I do to the customer) I just want to send a list of image numbers. Is there a way that I can send two different emails from the same file?Thanks Quote Link to comment https://forums.phpfreaks.com/topic/22415-multiple-emails-from-one-file/ Share on other sites More sharing options...
ober Posted September 28, 2006 Share Posted September 28, 2006 Yeah... just setup another call to mail(). The second call will have completely different details. Quote Link to comment https://forums.phpfreaks.com/topic/22415-multiple-emails-from-one-file/#findComment-100462 Share on other sites More sharing options...
watts Posted September 29, 2006 Author Share Posted September 29, 2006 I'm actually using phpMailer so the call is a little different. I've tried to just set up another instance but nothing happens. I don't get an error but I don't get the second email. The code for the first instance is:[code=php:0]require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.server"; // SMTP server $mail->From = "admin@domain.com"; $mail->FromName = "Kristin Lai"; $mail->AddAddress("$ToAddress"); $mail->Subject = "Your lightbox"; $mail->Body = "If you are interested in purchasing any of the attached images please <a href='http://www.domain.com/order.php'>contact us</a> and include the filenames in your email."; $mail->AltBody="If you are interested in purchasing any of the attached images please contact us at address@domain.com and include the filenames in your email."; if(!$mail->Send()) { echo "<div id='eMessage'>\n"; echo "Email was not sent\n"; echo "Mailer Error: " . $mail->ErrorInfo; echo "</div>\n"; } else { echo "<div id='eMessage'>\n"; echo "Your lightbox has been sent\n"; echo "</div>\n"; }[/code]and heres the code for the second instance:[code=php:0] $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "smtp.server"; $mail->FromAddress = "admin@domain.com"; $mail->FromName = "Stocksite"; $mail->AddAddress("client@domain.com"); $mail->Subject = "Lightbox Request"; $mail->Body = "The following images have been sent to $ToName at $ToAddress: $imageList";[/code]So I guess the question is, is there something else I should be adding or does phpMailer not allow for two instances? Quote Link to comment https://forums.phpfreaks.com/topic/22415-multiple-emails-from-one-file/#findComment-100957 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.