I've got the following code:

Code:

@mail($address, $title, $message , "From: ". $from . "\nContent-Type: text/plain; charset=utf-8");


Which sends a verification email to a registered user. The only problem is the email is considered bulk, and ends up in the bulk folder, or doesn't show up at all. I'm thinking this is a php problem, because I've tried using many different email addresses to send from.

Does anyone have any idea what's going on?

I've got the following code:

Code:

@mail($address, $title, $message , "From: ". $from . "\nContent-Type: text/plain; charset=utf-8");


Which sends a verification email to a registered user. The only problem is the email is considered bulk, and ends up in the bulk folder, or doesn't show up at all. I'm thinking this is a php problem, because I've tried using many different email addresses to send from.

Does anyone have any idea what's going on?

It looks like you have too much going on, on the from section. You're concantinating too much I think. This works fine for me,

mail($address,$title,$message,$from);

If that doesn't do it, it might be a server configuration.

It's still doing it. I'm really scared it might be server configuration.....Do you know how I would fix that?

Also, do you think it could be a problem with my ISP?

Try this class

class Email {

	/* Global Variables */

	//----------------------------------
	var $message;
	var $address_to;
	var $address_from;
	var $from_name;
	var $subject;
	//----------------------------------


	function setMessage($message) {
		$this->message = $message;
	}

	function setAddressTo($address_to) {
		$this->address_to = $address_to;
	}

	function setAddressFrom($address_from) {
		$this->address_from = $address_from;
	}

	function setFromName($from_name) {
		$this->from_name = $from_name;
	}

	function setSubject($subject) {
		$this->subject = $subject;
	}


	// SEND MAIL                           
	function sendMail() {
		$headers = "From: " . $this->from_name;
		$headers .= "<" . $this->address_from . ">\r\n";
		$headers .= "Reply-To: " . $this->address_from;

		mail($this->address_to, $this->subject, $this->message, $headers);

	}


}


?>

Does the header's domain name differ from the 'From' domain name in the email received? The reason I ask, is because the spam filtering software for the registered user's may not allow your mail to come through normally if the domain names do not match.

It might help if you give us an example of what a registered user would see in the header and in the 'From' field so we can compare the results.

Without knowing your server's configuration, that's my guess.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.