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! Quote Link to comment Share on other sites More sharing options...
mike12255 Posted January 24, 2011 Share Posted January 24, 2011 can i see your $mail2 function? Quote Link to comment 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 = "x@xx.com.au"; // SMTP username $mail->Password = "xx"; // SMTP password $mail->AddAddress($_POST['email']); $mail->From = "inx@ax.com.au"; //$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 = "ixo@alxe.com.au"; // SMTP username $mail2->Password = "ix"; // SMTP password $mail2->AddAddress($_POST['conf']); $mail2->From = "x@ax.com.au"; $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>'); } ?> Quote Link to comment Share on other sites More sharing options...
mako34 Posted January 24, 2011 Author Share Posted January 24, 2011 bump please Quote Link to comment 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"; Quote Link to comment 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! Quote Link to comment 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.