Jump to content

Recommended Posts

Email sending to many headers

I am sending out an email but it contains a repeat of some of the headers.
It gets rejected from some servers as having >128 recipients or excessively long headers. Since it is only sending to one recipient at a time, the 128 must refer to the headers.

Example:

Reply-To: Webite Name
	<[email protected]>, Webite Name

Repeated too many times to count 

X-Mailer: PHP/5.4.45From: Webite Name <[email protected]>

Also repeated too many times to count 


Below is my script:
 

if ($todaydate > $almostdue){
	$to2 = "$fname $lname <$email>";
	$subject2 = "Your Membership Dues are Expiring";	
	$headers2 .= "From: Website Name <[email protected]>" . "\r\n";
	$headers2 .= "Reply-To: Website Name <[email protected]>" . "\r\n";
	$headers2 .= "MIME-Version: 1.0" . "\r\n";
	$headers2 .= "Content-type:text/html;charset=UTF-8" . "\r\n";
	$headers2 .= 'X-Mailer: PHP/' . phpversion();
	$fromEmail = "[email protected]";
	$fifth = "-f" . $fromEmail;
	$message2 = "<div style='font-family:arial;font-size:14px;'>
	Dear $fname,<br><br>blah, blah,blah</div><br><br>";
	mail($to2, $subject2, $message2, $headers2, $fifth);	

Any help in why this is happening would be greatly appreciated






Why can't I paste anything here?

So, had to paste everything as code...

 

 

Link to comment
https://forums.phpfreaks.com/topic/300185-email-sending-to-many-headers/
Share on other sites

You are concatenating the first $headers2.

 

$headers2 .=

 

Why are you posting the same exact thing to this forum when you were already provided answers on another site forum? The answers are not going to be any different here.

 
 

Edited by benanamen
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.