1internet Posted February 14, 2013 Share Posted February 14, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/274496-email-issue-not-getting-through-to-all-addresses/ Share on other sites More sharing options...
DavidAM Posted February 14, 2013 Share Posted February 14, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/274496-email-issue-not-getting-through-to-all-addresses/#findComment-1412511 Share on other sites More sharing options...
1internet Posted February 14, 2013 Author Share Posted February 14, 2013 Oops, yea sorry I was copying and pasting the code, I am using the right -f address. But, I am using a test server on a different domain, so I am sure you must be right about that. Quote Link to comment https://forums.phpfreaks.com/topic/274496-email-issue-not-getting-through-to-all-addresses/#findComment-1412517 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.