{"id":48656,"date":"2021-03-18T09:59:31","date_gmt":"2021-03-18T09:59:31","guid":{"rendered":"https:\/\/www.awardspace.com\/?p=48656"},"modified":"2024-02-28T12:08:25","modified_gmt":"2024-02-28T12:08:25","slug":"unable-use-php-mail-function-from-my-paid-hosting-account","status":"publish","type":"post","link":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/","title":{"rendered":"I am unable to use the PHP mail() function from my premium hosting account, why?"},"content":{"rendered":"<p>Here is a script example you can test PHP mail function with:<\/p>\n<pre class=\"wp-block-code\"><code>&lt;?php\r\n$to = \"you@yourdomain.com\";\r\n$subject = \"Hi!\";\r\n$body = \"TEST\";\r\n$headers = \"MIME-Version: 1.0\\r\\n\";\r\n$headers .= \"Content-type:text\/html;charset=UTF-8\\r\\n\";\r\n$headers .= \"From: You &lt;you@yourdomain.com&gt;\\r\\n\";\r\n\r\nif(mail($to,$subject,$body,$headers)) {\r\necho \"MAIL - OK\";\r\n} else {\r\necho \"MAIL FAILED\";\r\n}\r\n?&gt;<\/code><\/pre>\n<p>This script is sending an email (to you@yourdomain.com) and printing &#8220;MAIL &#8211; OK&#8221; on the page.<\/p>\n<p>Tip: Please note that the &#8216;From&#8217; header should be an existing email account inside your Email Manager of your Hosting Control Panel.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a script example you can test PHP mail function with: &lt;?php $to = &#8220;you@yourdomain.com&#8221;; $subject = &#8220;Hi!&#8221;; $body = &#8220;TEST&#8221;; $headers = &#8220;MIME-Version: 1.0\\r\\n&#8221;; $headers .= &#8220;Content-type:text\/html;charset=UTF-8\\r\\n&#8221;; $headers .= &#8220;From: You &lt;you@yourdomain.com&gt;\\r\\n&#8221;; if(mail($to,$subject,$body,$headers)) { echo &#8220;MAIL &#8211; OK&#8221;; } else { echo &#8220;MAIL FAILED&#8221;; } ?&gt; This script is sending an email (to [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":33819,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[58],"tags":[],"class_list":["post-48656","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email-management"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>I am unable to use the PHP mail() function from my premium hosting account, why? - AwardSpace.com<\/title>\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.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"I am unable to use the PHP mail() function from my premium hosting account, why? - AwardSpace.com\" \/>\n<meta property=\"og:description\" content=\"Here is a script example you can test PHP mail function with: &lt;?php $to = &quot;you@yourdomain.com&quot;; $subject = &quot;Hi!&quot;; $body = &quot;TEST&quot;; $headers = &quot;MIME-Version: 1.0rn&quot;; $headers .= &quot;Content-type:text\/html;charset=UTF-8rn&quot;; $headers .= &quot;From: You &lt;you@yourdomain.com&gt;rn&quot;; if(mail($to,$subject,$body,$headers)) { echo &quot;MAIL - OK&quot;; } else { echo &quot;MAIL FAILED&quot;; } ?&gt; This script is sending an email (to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/\" \/>\n<meta property=\"og:site_name\" content=\"AwardSpace.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AwardSpace\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-18T09:59:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-28T12:08:25+00:00\" \/>\n<meta name=\"author\" content=\"Lazar Shishmanov, PhD\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@awspace\" \/>\n<meta name=\"twitter:site\" content=\"@awspace\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lazar Shishmanov, PhD\" \/>\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.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/\"},\"author\":{\"name\":\"Lazar Shishmanov, PhD\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b\"},\"headline\":\"I am unable to use the PHP mail() function from my premium hosting account, why?\",\"datePublished\":\"2021-03-18T09:59:31+00:00\",\"dateModified\":\"2024-02-28T12:08:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/\"},\"wordCount\":67,\"publisher\":{\"@id\":\"https:\/\/www.awardspace.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage\"},\"thumbnailUrl\":\"\",\"articleSection\":[\"Email Management\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/\",\"url\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/\",\"name\":\"I am unable to use the PHP mail() function from my premium hosting account, why? - AwardSpace.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.awardspace.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2021-03-18T09:59:31+00:00\",\"dateModified\":\"2024-02-28T12:08:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.awardspace.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Knowledge Base\",\"item\":\"https:\/\/www.awardspace.com\/kb\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"F.A.Q.\",\"item\":\"https:\/\/www.awardspace.com\/kb\/f-a-q\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Email Management\",\"item\":\"https:\/\/www.awardspace.com\/kb\/f-a-q\/email-management\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"I am unable to use the PHP mail() function from my premium hosting account, why?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.awardspace.com\/#website\",\"url\":\"https:\/\/www.awardspace.com\/\",\"name\":\"AwardSpace.com\",\"description\":\"Free Web Hosting with PHP, MySQL, Email Sending, No Ads\",\"publisher\":{\"@id\":\"https:\/\/www.awardspace.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.awardspace.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.awardspace.com\/#organization\",\"name\":\"AwardSpace.com\",\"url\":\"https:\/\/www.awardspace.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png\",\"contentUrl\":\"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png\",\"width\":1759,\"height\":176,\"caption\":\"AwardSpace.com\"},\"image\":{\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/AwardSpace\/\",\"https:\/\/x.com\/awspace\",\"https:\/\/www.instagram.com\/awardspace\/\",\"https:\/\/www.quora.com\/profile\/Award-Space\",\"https:\/\/www.linkedin.com\/company\/19214384\/\",\"https:\/\/www.reddit.com\/user\/AwardSpace\",\"https:\/\/www.pinterest.com\/awardspace\/\",\"https:\/\/www.youtube.com\/user\/AwardspaceWebHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b\",\"name\":\"Lazar Shishmanov, PhD\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g\",\"caption\":\"Lazar Shishmanov, PhD\"},\"description\":\"Lazar is a marketing specialist with more than ten years of experience in the field, eight of which as part of the marketing department at AwardSpace. Academically, Lazar holds a Bachelor's degree in Public Relations, a Master's degree in Semiotics, Language and Advertising, and is a PhD candidate in Integrated Marketing Communications. You can learn more about Lazar on his personal website.\",\"url\":\"https:\/\/www.awardspace.com\/author\/lazar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"I am unable to use the PHP mail() function from my premium hosting account, why? - AwardSpace.com","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.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/","og_locale":"en_US","og_type":"article","og_title":"I am unable to use the PHP mail() function from my premium hosting account, why? - AwardSpace.com","og_description":"Here is a script example you can test PHP mail function with: &lt;?php $to = \"you@yourdomain.com\"; $subject = \"Hi!\"; $body = \"TEST\"; $headers = \"MIME-Version: 1.0rn\"; $headers .= \"Content-type:text\/html;charset=UTF-8rn\"; $headers .= \"From: You &lt;you@yourdomain.com&gt;rn\"; if(mail($to,$subject,$body,$headers)) { echo \"MAIL - OK\"; } else { echo \"MAIL FAILED\"; } ?&gt; This script is sending an email (to [&hellip;]","og_url":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/","og_site_name":"AwardSpace.com","article_publisher":"https:\/\/www.facebook.com\/AwardSpace\/","article_published_time":"2021-03-18T09:59:31+00:00","article_modified_time":"2024-02-28T12:08:25+00:00","author":"Lazar Shishmanov, PhD","twitter_card":"summary_large_image","twitter_creator":"@awspace","twitter_site":"@awspace","twitter_misc":{"Written by":"Lazar Shishmanov, PhD","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#article","isPartOf":{"@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/"},"author":{"name":"Lazar Shishmanov, PhD","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b"},"headline":"I am unable to use the PHP mail() function from my premium hosting account, why?","datePublished":"2021-03-18T09:59:31+00:00","dateModified":"2024-02-28T12:08:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/"},"wordCount":67,"publisher":{"@id":"https:\/\/www.awardspace.com\/#organization"},"image":{"@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage"},"thumbnailUrl":"","articleSection":["Email Management"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/","url":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/","name":"I am unable to use the PHP mail() function from my premium hosting account, why? - AwardSpace.com","isPartOf":{"@id":"https:\/\/www.awardspace.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage"},"image":{"@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage"},"thumbnailUrl":"","datePublished":"2021-03-18T09:59:31+00:00","dateModified":"2024-02-28T12:08:25+00:00","breadcrumb":{"@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/www.awardspace.com\/kb\/unable-use-php-mail-function-from-my-paid-hosting-account\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.awardspace.com\/"},{"@type":"ListItem","position":2,"name":"Knowledge Base","item":"https:\/\/www.awardspace.com\/kb\/"},{"@type":"ListItem","position":3,"name":"F.A.Q.","item":"https:\/\/www.awardspace.com\/kb\/f-a-q\/"},{"@type":"ListItem","position":4,"name":"Email Management","item":"https:\/\/www.awardspace.com\/kb\/f-a-q\/email-management\/"},{"@type":"ListItem","position":5,"name":"I am unable to use the PHP mail() function from my premium hosting account, why?"}]},{"@type":"WebSite","@id":"https:\/\/www.awardspace.com\/#website","url":"https:\/\/www.awardspace.com\/","name":"AwardSpace.com","description":"Free Web Hosting with PHP, MySQL, Email Sending, No Ads","publisher":{"@id":"https:\/\/www.awardspace.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.awardspace.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.awardspace.com\/#organization","name":"AwardSpace.com","url":"https:\/\/www.awardspace.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png","contentUrl":"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png","width":1759,"height":176,"caption":"AwardSpace.com"},"image":{"@id":"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/AwardSpace\/","https:\/\/x.com\/awspace","https:\/\/www.instagram.com\/awardspace\/","https:\/\/www.quora.com\/profile\/Award-Space","https:\/\/www.linkedin.com\/company\/19214384\/","https:\/\/www.reddit.com\/user\/AwardSpace","https:\/\/www.pinterest.com\/awardspace\/","https:\/\/www.youtube.com\/user\/AwardspaceWebHosting"]},{"@type":"Person","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b","name":"Lazar Shishmanov, PhD","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g","caption":"Lazar Shishmanov, PhD"},"description":"Lazar is a marketing specialist with more than ten years of experience in the field, eight of which as part of the marketing department at AwardSpace. Academically, Lazar holds a Bachelor's degree in Public Relations, a Master's degree in Semiotics, Language and Advertising, and is a PhD candidate in Integrated Marketing Communications. You can learn more about Lazar on his personal website.","url":"https:\/\/www.awardspace.com\/author\/lazar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts\/48656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/comments?post=48656"}],"version-history":[{"count":0,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts\/48656\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/media?parent=48656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/categories?post=48656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/tags?post=48656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}