0

I use PHPMailer class. I've written a test email like this:

$mail = new PHPMailer();
$mail->SMTPDebug  = 2;   
$mail->Username   = "username"; 
$mail->Password   = "aaa";  
$mail->SetFrom('mail', 'name');
$mail->AddReplyTo("mail","name");
$mail->Subject    = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->MsgHTML('BODYYY OF MESSAGE');
$address = "address";
$mail->AddAddress($address, "name");
$mail->addCC("mail", "name");
$mail->AddAttachment("a.jpg");      // attachment
$mail->Send();

Everything is all right, but it don't appended subject to header, i see code it appended only when called DKIM_add function. How can i send Subject without DKIM_add function?

akkloshank
  • 53
  • 1
  • 2
  • 9
  • 2
    probably just a typo here, but your `->SetFrom` line is missing a `'` after `name`. – Marc B Dec 15 '13 at 23:46
  • @ekaj: no, no with phpmailer. subject is a property, not a method. – Marc B Dec 15 '13 at 23:46
  • @MarcB I was looking for that, you're right. If not notice from the syntax highlighting most of it is lost after that typo, i.e. AddReplyTo is not highlighted like Password and SetFrom... and I removed that, thanks :) – cutrightjm Dec 15 '13 at 23:47
  • 1
    No, the code here has a syntax error: $mail->SetFrom('mail', 'name); You never closed that string – Zarathuztra Dec 15 '13 at 23:47
  • I delete ' when i edit code, i test with normal code and it works. – akkloshank Dec 15 '13 at 23:49
  • @akkloshank What do you mean "test with normal code and it works"? – Zarathuztra Dec 15 '13 at 23:50
  • When i look code, Subject used only in DKIM_add fucntion, how smtp send should send suject? – akkloshank Dec 15 '13 at 23:51
  • In my code isn't syntax errors (i delete ' when edit code before publishing), and i check header in db (i keep message in db). Just subject isn't there – akkloshank Dec 15 '13 at 23:52
  • @akkloshank Show us how u save in DB.. – Lucky Soni Dec 16 '13 at 00:07
  • Why? i output on colsole before storing in db, Subject isn't (server application is in c# and i output received header lines), and in code too Subject don't appended, i just want to know how phpmailer sends subject using smtpSend ( i see it appends only in mail and sendmailSend functions – akkloshank Dec 16 '13 at 00:12

0 Answers0