Jump to content

how to put multiple info on subject


mako34

Recommended Posts

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

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>');
} 
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.