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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.