mako34 Posted January 24, 2011 Share Posted January 24, 2011 hello, im using the php mailer, working nicely but I need to put 3 values in my from fields in subject, now I have just 1 field $mail2->Subject = ($_POST['name']); I need to include in the subject email, commas and a message, I tried the following, but not working (noob learning!) $mail2->Subject = ($_POST['name'] "," $_POST['email'] "," "confirmation mail" ); thank you so much! Link to comment https://forums.phpfreaks.com/topic/225454-how-to-put-multiple-info-on-subject/ Share on other sites More sharing options...
mike12255 Posted January 24, 2011 Share Posted January 24, 2011 can i see your $mail2 function? Link to comment https://forums.phpfreaks.com/topic/225454-how-to-put-multiple-info-on-subject/#findComment-1164206 Share on other sites More sharing options...
mako34 Posted January 24, 2011 Author Share Posted January 24, 2011 hello, mail2 is just a second mail sent from my sendmail.php <?php require("../phpmailer/class.phpmailer.php"); include("email.php"); include("email2.php"); $name = $_POST['name']; $childname = $_POST['childname']; $site = $_POST['site']; $days = $_POST['days']; $conf = $_POST['conf']; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->Host = "mail.axx.com.au"; // SMTP servers $mail->Username = "[email protected]"; // SMTP username $mail->Password = "xx"; // SMTP password $mail->AddAddress($_POST['email']); $mail->From = "[email protected]"; //$mail->FromName = $_POST['name']; $mail->FromName = "Axe_online"; $mail->Subject = "Message from Alxe"; $mail->IsHTML(true); $mail->Body = $message; $mail->AddAttachment("../attachs/Alx.pdf"); $mail->AddAttachment("../attachs/Eax.pdf"); if($mail->Send()) { echo "Message sent! Thanks ! "; echo ""; } $mail2 = new PHPMailer(); $mail2->IsSMTP(); $mail2->SMTPAuth = true; $mail2->Host = "xl.alxe.com.au"; // SMTP servers $mail2->Username = "[email protected]"; // SMTP username $mail2->Password = "ix"; // SMTP password $mail2->AddAddress($_POST['conf']); $mail2->From = "[email protected]"; $mail2->FromName = "Ax_online"; //$mail2->Subject = "Confirmation mail"; $mail2->Subject = ($_POST['name']); $mail2->IsHTML(true); $mail2->Body = $message2; if($mail2->Send()) { echo "Confirmation sent! "; echo " \n"; print('<a href="http://www.ax.com.au/mail/form.html">Reset and Back</a>'); } ?> Link to comment https://forums.phpfreaks.com/topic/225454-how-to-put-multiple-info-on-subject/#findComment-1164209 Share on other sites More sharing options...
mako34 Posted January 24, 2011 Author Share Posted January 24, 2011 bump please Link to comment https://forums.phpfreaks.com/topic/225454-how-to-put-multiple-info-on-subject/#findComment-1164250 Share on other sites More sharing options...
DavidAM Posted January 24, 2011 Share Posted January 24, 2011 Just concatenate the strings together: $mail2->Subject = $_POST['name'] . ' - ' . $_POST['email'] . " - confirmation mail"; Link to comment https://forums.phpfreaks.com/topic/225454-how-to-put-multiple-info-on-subject/#findComment-1164251 Share on other sites More sharing options...
mako34 Posted January 24, 2011 Author Share Posted January 24, 2011 Just concatenate the strings together: $mail2->Subject = $_POST['name'] . ' - ' . $_POST['email'] . " - confirmation mail"; concatenate!! of course, thanks bro! Link to comment https://forums.phpfreaks.com/topic/225454-how-to-put-multiple-info-on-subject/#findComment-1164261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.