Jump to content

email issue - not getting through to all addresses


1internet

Recommended Posts

I have a hosting account that requires the addition -f parameter for sending emails. It seems to be sending emails to some addresses, but not all, and I am not sure why this is the case.

$to = 'test@email.com';
$subject = 'test email';
$body = 'test';
$header .= 'From: admin@test.com'. "\r\n";
$header .= 'Reply-To: admin@test.com;
$ffrom = '-f'.$to;
@mail ($to, $subject, $body, $header,$ffrom);

 

Why might this work for some email addresses and not others? Could it be the php.ini?

The -f specifies who the mail is from not who it is to. It should be an email address that has authority to send from the mail server (i.e. one provided by your host).

 

As to why it might work on some: Using an email address as the FROM address that does not "belong to" the sending server, is considered forgery by some receiving servers. They may therefore put the email in a junk folder, refuse delivery (and bounce it), or just discard it. Different (receiving) servers may behave differently.

Archived

This topic is now archived and is closed to further replies.

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