Jump to content

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.

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.