Jump to content

Recommended Posts

Posted

Hi, I am working on a clients site, got her set up with you guys, as I have had a good experience with you... She is on the dooku server (into starwars names my guess)

 

Here is my problem. I wrote an email function that should email to a person. It doesnt, and fails when trying... I looked over the forums and found that I should be using a -f additional parameter, but that didnt seem to fix it.

 

Any help would be greatly appreciated.

 

>function mailme($to, $subject, $message){
global $fromemailaddress;
$headers="MIME-Version: 1.0\r\n";
$headers.="Content-type: text/html; charset=iso-8859-1\r\n";
$headers.="From: $fromemailaddress\r\n";
$headers.="Reply-To: $fromemailaddress\r\n";
$headers.="X-Mailer: PHP/".phpversion();
print "$to\n\n$subject\n\n$message\n\n\n\n$headers\n\n-f$fromemailaddress\n\n\n\n";
if(mail($to,$subject,$message,$headers,"-f$fromemailaddress")){print "Mail Sent";}else{print "Mail Rejected";}
}

 

I tested it with a webmaster@mysite.com as well as the actual email address the client is using, but nothing is working.

 

No mail is being sent, and it of course prints Mail Rejected...

Posted

It looks ok but maybe this would make it work

 

>$ok = @mail($to, $subject, $message, $headers,"-f$fromemailaddress");
	if ($ok) {
		print "Mail Sent";
	} else {
		print "Mail Rejected";
	}

Posted
It looks ok but maybe this would make it work

 

>$ok = @mail($to, $subject, $message, $headers,"-f$fromemailaddress");
	if ($ok) {
		print "Mail Sent";
	} else {
		print "Mail Rejected";
	}

 

Hmmm.... I actually dont think it was broke... I may have been stupid and was using some test email that wasnt really an email address.

 

Oh well. it works now.

Thanks

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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