Jump to content

Recommended Posts

What is the best way for sending email from PHP pages? I have two different cases, the first of single emails and then I also send bulk emails to many people at once, say 100.  Obviously need to hide the email addresses from the other people. Looking for the best way to get it passed spam filters and delivered with headers that dont cause red flags. Also efficient is always preferred :]

Link to comment
https://forums.phpfreaks.com/topic/254137-email/
Share on other sites

Use a service designed for this. Like http://www.benchmarkemail.com/

 

There's a bunch more but I can't think of the names right now.

 

Basically these services take a lot of steps to ensure mail is delivered. You won't ever have to worry about being black-listed or getting through spam filters.

Link to comment
https://forums.phpfreaks.com/topic/254137-email/#findComment-1302882
Share on other sites

Most of the services have API's.

 

To answer your original question, just use a loop to send an email X amount of times. If you send a large amount of mail within a short period of time you run the risk of being marked as a spammer, so it's advised to break up large amounts of mail into smaller chunks and spaced out a little.

Link to comment
https://forums.phpfreaks.com/topic/254137-email/#findComment-1302887
Share on other sites

It will work.

 

You could try PEAR::Mail if you want a little more capability.

 

i get this as the from on gmail

[email protected] via SERVERHIDDEN.inmotionhosting.com

when trying to use php's mail is there a way to avoid this?

 

You can use mail headers to change the from.

Link to comment
https://forums.phpfreaks.com/topic/254137-email/#findComment-1302890
Share on other sites

What would the headers have to be? this is what im using:

 

		$to = $email;
	$subject = "Mad Dog Mania Email Validation";
	$message = "Test";
	$from = "Mad Dog Mania <[email protected]>";
	$reply = "Steven Stangle <[email protected]>";
	$headers = 'From: '  . $from . "\r\n";
	$headers .= 'Reply-to: '  . $reply . "\r\n";

	$headers .= 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

	@mail($email,$subject,$message,$headers);

 

and i get these headers on gmail:

 

from: Mad Dog Mania [email protected] via ****.inmotionhosting.com

sender-time: Sent at 1:13 PM (GMT-05:00). Current time there: 1:19 PM. ✆

reply-to: Steven Stangle <[email protected]>

to: [email protected]

date: Sat, Dec 31, 2011 at 1:13 PM

subject: Mad Dog Mania Email Validation

mailed-by: ****.inmotionhosting.com

Link to comment
https://forums.phpfreaks.com/topic/254137-email/#findComment-1302891
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.