{"id":679,"date":"2011-08-26T17:49:00","date_gmt":"2011-08-26T17:49:00","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2011\/08\/26\/why-wont-my-php-app-send-mail\/"},"modified":"2022-12-06T16:44:43","modified_gmt":"2022-12-06T21:44:43","slug":"why-wont-my-php-app-send-mail","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/","title":{"rendered":"Why won&#8217;t my PHP app send mail?"},"content":{"rendered":"\n<p>To comply with current SPAM standards involved with the PHP &#8216;nobody&#8217; user, our newer servers that run PHP under Apache do not allow PHP to send mail via the mail() function, which is the default for most software. In order for you to be able to send mail you&#8217;ll need to configure the software to use SMTP with authentication, similar to how a mail client is set up. Most pre-bundled software packages like Joomla, phpBB, and other CMS&#8217;s have an option or plugin that will allow you to use SMTP instead of mail() or sendmail. Custom mailing scripts can usually be programmed to use SMTP using PEAR or the popular phpMailer class:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/PHPMailer\/PHPMailer\">https:\/\/github.com\/PHPMailer\/PHPMailer<\/a><\/p>\n\n\n\n<p>For a phpMailer tutorial, please see this guide:<\/p>\n\n\n\n<p><a href=\"\/support\/email\/using-phpmailer-to-send-mail-through-php\/\">Using phpMailer to Send Mail through PHP<\/a><\/p>\n\n\n\n<p>To use SMTP you will need to use a valid email address that you&#8217;ve created in your cPanel. Most software will ask for these settings:<\/p>\n\n\n\n<p><strong>Hostname: localhost OR mail.example.com<\/strong><\/p>\n\n\n\n<p><strong>Authentication: Yes<\/strong><\/p>\n\n\n\n<p><strong>Username: your@emailaddress.com<\/strong><\/p>\n\n\n\n<p><strong>Password: Your email password<\/strong><\/p>\n\n\n\n<p><strong>Port: 25 \/ No SSL<\/strong><\/p>\n\n\n\n<p>or<\/p>\n\n\n\n<p><strong>Port 465 \/ SSL<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To comply with current SPAM standards involved with the PHP &#8216;nobody&#8217; user, our newer servers that run PHP under Apache do not allow PHP to send mail via the mail() function, which is the default for most software. In order for you to be able to send mail you&#8217;ll need to configure the software to<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\"> Read More ><\/a><\/p>\n","protected":false},"author":56983,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,4288],"tags":[],"class_list":["post-679","post","type-post","status-publish","format-standard","hentry","category-email","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Why won&#039;t my PHP app send mail? | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this article, we will troubleshoot why won&#039;t a PHP app send mail.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why won&#039;t my PHP app send mail? | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this article, we will troubleshoot why won&#039;t a PHP app send mail.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2011-08-26T17:49:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-06T21:44:43+00:00\" \/>\n<meta name=\"author\" content=\"Carrie Smaha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@carriesmaha\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carrie Smaha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\"},\"author\":{\"name\":\"Carrie Smaha\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\"},\"headline\":\"Why won&#8217;t my PHP app send mail?\",\"datePublished\":\"2011-08-26T17:49:00+00:00\",\"dateModified\":\"2022-12-06T21:44:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\"},\"wordCount\":190,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Email\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\",\"name\":\"Why won't my PHP app send mail? | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2011-08-26T17:49:00+00:00\",\"dateModified\":\"2022-12-06T21:44:43+00:00\",\"description\":\"In this article, we will troubleshoot why won't a PHP app send mail.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why won&#8217;t my PHP app send mail?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\",\"name\":\"Carrie Smaha\",\"description\":\"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/carriesmaha\/\",\"https:\/\/x.com\/carriesmaha\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Why won't my PHP app send mail? | InMotion Hosting","description":"In this article, we will troubleshoot why won't a PHP app send mail.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/","og_locale":"en_US","og_type":"article","og_title":"Why won't my PHP app send mail? | InMotion Hosting","og_description":"In this article, we will troubleshoot why won't a PHP app send mail.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2011-08-26T17:49:00+00:00","article_modified_time":"2022-12-06T21:44:43+00:00","author":"Carrie Smaha","twitter_card":"summary_large_image","twitter_creator":"@carriesmaha","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Carrie Smaha","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/"},"author":{"name":"Carrie Smaha","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8"},"headline":"Why won&#8217;t my PHP app send mail?","datePublished":"2011-08-26T17:49:00+00:00","dateModified":"2022-12-06T21:44:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/"},"wordCount":190,"commentCount":4,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Email","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/","name":"Why won't my PHP app send mail? | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2011-08-26T17:49:00+00:00","dateModified":"2022-12-06T21:44:43+00:00","description":"In this article, we will troubleshoot why won't a PHP app send mail.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/why-wont-my-php-app-send-mail\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Why won&#8217;t my PHP app send mail?"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8","name":"Carrie Smaha","description":"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.","sameAs":["https:\/\/www.linkedin.com\/in\/carriesmaha\/","https:\/\/x.com\/carriesmaha"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4288,"name":"Website","slug":"website","link":"https:\/\/www.inmotionhosting.com\/support\/website\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/56983"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=679"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/679\/revisions"}],"predecessor-version":[{"id":101932,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/679\/revisions\/101932"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}