Forum Moderators: coopster

Message Too Old, No Replies

'Nobody' disallowed from sending email with PHP

My host wants to avoid spam

         

guarriman

11:32 pm on Sep 14, 2005 (gmt 0)

10+ Year Member



Hi.

My host decided to disallow mails from 'nobody' ('nobody' is the user of PHP+Apache) due to spam problems.

I use the PHP mail function to send out a confirmation email for new users, and it doesn't work.

I checked this thread:
[webmasterworld.com...]
but there isn't any solution there.

Any similar problem? Thx.

jatar_k

12:13 am on Sep 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



will it allow you to set the from, reply to and return path?
if so does that trick it?

guarriman

9:12 am on Sep 15, 2005 (gmt 0)

10+ Year Member



I changed:

From: myname@mydomain.com
but it doesn't work :(

Must I change also 'Return' and 'Reply'? How can I
perform it?

Thank you for the answer.

Angelis

9:35 am on Sep 15, 2005 (gmt 0)

10+ Year Member



Same problem with my dedicated server and even when I change the suexec settings it still doesnt work, im putting it down to PHP 5 being buggy on my server but if anyone else has an answer it would be great.

jatar_k

2:42 pm on Sep 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well, I have had this issue sort of when I have had the email always be sent from nobody and trying to change that. The problem is it depends if it interprets the actual user or if you set up all the headers properly if it will be satisfied.

you could use something like this

$headers = '';
$headers .= "From: " . $name . " <" . $sourceemail . ">\r\n";
$headers .= "Return-Path: " . $sourceemail . "\r\n";
$headers .= "Reply-To: " . $sourceemail . "\r\n";
$headers .= "Content-type: text;\r\n";
$headers .= "Mime-Version: 1.0\r\n";

$sourceemail being the address it is coming from

Sarah Atkinson

5:50 pm on Sep 15, 2005 (gmt 0)

10+ Year Member



my Host sent out an e-mail saying they were chainging the php sned mail setings here is whatthey sent me explaining what to do.


This email is to inform you of a change that will affect customers utilizing PHP email scripts.

Starting on Thursday, September 15th, you will need to specify your mail server and list a valid email address as your 'Send Mail From' address.

So in your PHP email script:

/* Specify your SMTP Server, Port and Valid From Address */
ini_set("SMTP","mail.yourdomain.com");
ini_set("smtp_port","25");
ini_set("sendmail_from","fromYou@yourdomain.com.com");

The you@yourdomain.com must be a valid email address. Please see Article # 737 ("PHP Email Example") in our Knowledge Base for the entire sample script.

This is being enacted to enhance the security of our mail servers and prevent spam practices. Should you have any questions or concerns,

Sarah Atkinson

5:52 pm on Sep 15, 2005 (gmt 0)

10+ Year Member



and here is article 737

<?PHP
/* Setup your Subject and Message Body */
$subject='Testing PHP Email';
$body='Put Your Text Message Here.';

/* Specify your SMTP Server, Port and Valid From Address */
ini_set("SMTP","mail.yourdomain.com");
ini_set("smtp_port","25");
ini_set("sendmail_from","fromYou@yourdomain.com");

/* Additional Headers */
$headers = "Cc:Real CC Name <ccUser@theirdomain.com>\r\n";
$headers .= "Bcc:Real BCC Name <bccUser@theirdomain.com>\r\n";

/* Try to send message and respond if it sends or fails. */
if(mail ('ToPersonsName <toPerson@theirdomain.com>', $subject, $body, $headers )){
echo "<h2>Your Message was sent!</h2>";
}
else{
echo "<font color='red'><h2>Your Message Was Not Sent!</h2></font>";
}
exit;
?>

JavaErb

3:00 pm on Sep 22, 2005 (gmt 0)



I also got that last e-mail, but in mine their example was wrong, they used "smtp" instead of "SMTP". I am still having trouble even after that, and am trying to work it out.