Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3481678
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:28:26+00:00 2026-05-18T10:28:26+00:00

I am using phps mail() function to send confirmation e-mails. The e-mails get received

  • 0

I am using phps mail() function to send confirmation e-mails.

The e-mails get received on gmail and others as far as I’m aware, the only real problems I’ve had is when sending the e-mails to a Hotmail or Yahoo account.

I have read on the internet and many people suggest PHPmailer

What do you guys suggest to do when sending php mail()? This website I’m creating is for a legitimate business and I need mail to be sent and received no matter whom I send it to.

Below is my code currently, I’ve used specific headers to try solve the problems. I own my own dedicated server and I’m not blacklisted on any spam lists, all I can think of is it is php itself.

$to = $email;
$subject = "Subject";
$body = "Message";
$headers .= "From: Accounts <accounts@site.com>\r\n";
$headers .= "Reply-To: <accounts@site.com>\r\n";
$headers .= "X-Sender: <accounts@site.com>\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . '\r\n'; //mailer
$headers .= "X-Priority: 3\r\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <accounts@site.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n"; 
mail($to, $subject, $body, $headers);

Any help is greatly appreciated.

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:28:27+00:00Added an answer on May 18, 2026 at 10:28 am

    Using PHPMailer, or swiftmailer or any other library won’t increase your delivery rates in most cases: the most likely culprit is your server set up.

    Sending email successfully is notoriously difficult, have a read here: http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html for a basic overview of what’s necessary.

    Yahoo in particular really wants DKIM set up, and if your ISP hasn’t done this for you, or you are on a VPS, can be a real pain.

    Sucessfully sending email takes quite a bit more then simply not being on blacklists. The default of many ISPs it so assume you are SPAM until you have things set up that would make them think otherwise. Guilty until proven innocent.

    In the codinghorror post, take note of this passage:

    Port25 offers a really nifty public
    service — you can send email to
    check-auth@verifier.port25.com and it
    will reply to the from: address with
    an extensive diagnostic!

    I had to use an alternate address for the test to work; check-auth2@verifier.port25.com. You can read the details of why to test with each address here: http://www.port25.com/domainkeys/

    In the long run, if you’re sending transactional email (ie. not mass mailings but email in response to a user action) I recommend a service like postmark (postmarkapp.com) because at 1/10th of a cent per email, you get all the ugly taken care of for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to send an email from my localhost machine (using PHPs mail function)
I tried to send a text email with non-English characters using PHPs mail function.
I am using php's mail() function to send an email from a php scrpit,
i've been using php's pear Mail & Mail_Mime libraries to send well formatted html
We are using sendmail to send mails from our web app and we do
What is the simplest way to send mail using Ruby on Rails? Is there
I'm currently using PHP's mail() function to email the HTML Body of another PHP
I'm trying to send out a Plain/HTML multipart email out and I'm currently using
In using PHP's DOM classes (DOMNode, DOMEElement, etc) I have noticed that they possess
At the team with which I work, we have an old codebase using PHP's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.