{"id":1096,"date":"2024-06-11T17:26:02","date_gmt":"2024-06-11T21:26:02","guid":{"rendered":"https:\/\/docs.gravitysmtp.com\/?p=1096"},"modified":"2024-08-21T06:07:51","modified_gmt":"2024-08-21T10:07:51","slug":"using-php-mail","status":"publish","type":"post","link":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/","title":{"rendered":"Using PHP Mail"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-introduction\">Introduction<\/h2>\n\n\n\n<p>This article guides you through the process of using Gravity SMTP to integrate your website email connection with the PHP Mail function. This will allow you to use the built-in PHP function, providing a simple way to compose and send emails using the server&#8217;s mail system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-about-php-mail\">About PHP Mail<\/h2>\n\n\n\n<p>The PHP Mail function is a tool used by web developers to send emails directly from a website. It is a simple email sender that can send messages to users, such as order confirmations or notifications. However, it&#8217;s unreliable; it doesn&#8217;t track if the email was delivered or opened and sent messages can inadvertently be marked as spam.<\/p>\n\n\n\n<p>PHP Mail can slow down the website if many emails are sent simultaneously. Setting it up correctly on the server can be tricky, so many developers prefer using dedicated email services for sending important messages. The PHP Mail connection is not recommended for transactional emails due to its lack of reliability. High-volume email sending can overwhelm the server and risk emails being marked as spam without proper authentication mechanisms.<\/p>\n\n\n\n<p>When no email integrations are active within Gravity SMTP, the plugin defaults to using the WordPress core function&nbsp;<code>wp_mail()<\/code> which itself defaults to using the server&#8217;s PHPMailer library.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-general-settings\">General Settings<\/h3>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1144\" height=\"902\" src=\"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18.png\" alt=\"Image showing PHP Mail Settings.\" class=\"wp-image-1795\" style=\"width:500px\" srcset=\"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18.png 1144w, https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18-300x237.png 300w, https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18-1024x807.png 1024w, https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18-768x606.png 768w\" sizes=\"auto, (max-width: 1144px) 100vw, 1144px\" \/><\/figure>\n<\/div>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Tag<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><strong>Return Path<\/strong><\/td><td>Adds the return path to the email header which indicates where non-deliverable notifications should be sent. Bounce messages may be lost if not enabled.<\/td><\/tr><tr><td><strong>From Email<\/strong><\/td><td>The <strong>from:<\/strong> email addressed to be used for outgoing messages. <em>Only applied when the <strong>from:<\/strong> property is not explicitly set in the message being processed.<\/em><\/td><\/tr><tr><td><strong>Force Email<\/strong><\/td><td>If enabled, the From Email setting (above) will override any <strong>from:<\/strong> settings for outgoing email messages.<\/td><\/tr><tr><td><strong>From Name<\/strong><\/td><td>The <strong>from:<\/strong> name associated with outgoing messages. <em>This is only<em> applied when the <strong>from:<\/strong> property is not explicitly set in the message being processed.<\/em><\/em><\/td><\/tr><tr><td><strong>Force Name<\/strong><\/td><td>If enabled, the From Name setting (above) will override any <strong>from:<\/strong> settings for all outgoing email messages.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-default-email-sending-behavior-in-gravity-smtp\">Default Email Sending Behavior in Gravity SMTP<\/h2>\n\n\n\n<p>When no email integrations are active within Gravity Forms, the plugin defaults to using the WordPress core function <code>wp_mail()<\/code>. By default, <code>wp_mail()<\/code> uses PHPMailer to send emails, but the method of sending emails can vary based on your server&#8217;s setup.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article guides you through the process of using Gravity SMTP to integrate your website email connection to by using PHP Mail function.<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_autodraft_ids":[],"_sb_is_suggestion_mode":false,"_sb_show_suggestion_boards":false,"_sb_show_comment_boards":false,"_sb_suggestion_history":"","_sb_update_block_changes":"","_is_real_time_mode":false,"_realtime_collaborators":"","footnotes":"","cf_checklist_status":[]},"categories":[5],"tags":[],"class_list":["post-1096","post","type-post","status-publish","format-standard","hentry","category-integrations","wpautop"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.6.1 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Using PHP Mail - Gravity SMTP Documentation<\/title>\n<meta name=\"description\" content=\"This article guides you through the process of using Gravity SMTP to integrate your website email connection with the PHP Mail function.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/docs.gravitysmtp.com\/using-php-mail\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using PHP Mail\" \/>\n<meta property=\"og:description\" content=\"This article guides you through the process of using Gravity SMTP to integrate your website email connection with the PHP Mail function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/docs.gravitysmtp.com\/using-php-mail\/\" \/>\n<meta property=\"og:site_name\" content=\"Gravity SMTP Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-11T21:26:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-21T10:07:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/06\/image-35-1024x989.png\" \/>\n<meta name=\"author\" content=\"Dario N\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dario N\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/\"},\"author\":{\"name\":\"Dario N\",\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/#\\\/schema\\\/person\\\/dda70b11383b5d9524fbeaf4b7d0b80a\"},\"headline\":\"Using PHP Mail\",\"datePublished\":\"2024-06-11T21:26:02+00:00\",\"dateModified\":\"2024-08-21T10:07:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/\"},\"wordCount\":378,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image-18.png\",\"articleSection\":[\"Integrations\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/\",\"url\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/\",\"name\":\"Using PHP Mail - Gravity SMTP Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image-18.png\",\"datePublished\":\"2024-06-11T21:26:02+00:00\",\"dateModified\":\"2024-08-21T10:07:51+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/#\\\/schema\\\/person\\\/dda70b11383b5d9524fbeaf4b7d0b80a\"},\"description\":\"This article guides you through the process of using Gravity SMTP to integrate your website email connection with the PHP Mail function.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#primaryimage\",\"url\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image-18.png\",\"contentUrl\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image-18.png\",\"width\":1144,\"height\":902},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/using-php-mail\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using PHP Mail\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/#website\",\"url\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/\",\"name\":\"Gravity SMTP Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/#\\\/schema\\\/person\\\/dda70b11383b5d9524fbeaf4b7d0b80a\",\"name\":\"Dario N\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g\",\"caption\":\"Dario N\"},\"url\":\"https:\\\/\\\/docs.gravitysmtp.com\\\/author\\\/dario\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Using PHP Mail - Gravity SMTP Documentation","description":"This article guides you through the process of using Gravity SMTP to integrate your website email connection with the PHP Mail function.","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:\/\/docs.gravitysmtp.com\/using-php-mail\/","og_locale":"en_US","og_type":"article","og_title":"Using PHP Mail","og_description":"This article guides you through the process of using Gravity SMTP to integrate your website email connection with the PHP Mail function.","og_url":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/","og_site_name":"Gravity SMTP Documentation","article_published_time":"2024-06-11T21:26:02+00:00","article_modified_time":"2024-08-21T10:07:51+00:00","og_image":[{"url":"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/06\/image-35-1024x989.png","type":"","width":"","height":""}],"author":"Dario N","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dario N","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/#article","isPartOf":{"@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/"},"author":{"name":"Dario N","@id":"https:\/\/docs.gravitysmtp.com\/#\/schema\/person\/dda70b11383b5d9524fbeaf4b7d0b80a"},"headline":"Using PHP Mail","datePublished":"2024-06-11T21:26:02+00:00","dateModified":"2024-08-21T10:07:51+00:00","mainEntityOfPage":{"@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/"},"wordCount":378,"commentCount":0,"image":{"@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/#primaryimage"},"thumbnailUrl":"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18.png","articleSection":["Integrations"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/docs.gravitysmtp.com\/using-php-mail\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/","url":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/","name":"Using PHP Mail - Gravity SMTP Documentation","isPartOf":{"@id":"https:\/\/docs.gravitysmtp.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/#primaryimage"},"image":{"@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/#primaryimage"},"thumbnailUrl":"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18.png","datePublished":"2024-06-11T21:26:02+00:00","dateModified":"2024-08-21T10:07:51+00:00","author":{"@id":"https:\/\/docs.gravitysmtp.com\/#\/schema\/person\/dda70b11383b5d9524fbeaf4b7d0b80a"},"description":"This article guides you through the process of using Gravity SMTP to integrate your website email connection with the PHP Mail function.","breadcrumb":{"@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/docs.gravitysmtp.com\/using-php-mail\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/#primaryimage","url":"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18.png","contentUrl":"https:\/\/docs.gravitysmtp.com\/wp-content\/uploads\/2024\/09\/image-18.png","width":1144,"height":902},{"@type":"BreadcrumbList","@id":"https:\/\/docs.gravitysmtp.com\/using-php-mail\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/docs.gravitysmtp.com\/"},{"@type":"ListItem","position":2,"name":"Using PHP Mail"}]},{"@type":"WebSite","@id":"https:\/\/docs.gravitysmtp.com\/#website","url":"https:\/\/docs.gravitysmtp.com\/","name":"Gravity SMTP Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/docs.gravitysmtp.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/docs.gravitysmtp.com\/#\/schema\/person\/dda70b11383b5d9524fbeaf4b7d0b80a","name":"Dario N","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g","caption":"Dario N"},"url":"https:\/\/docs.gravitysmtp.com\/author\/dario\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/posts\/1096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/comments?post=1096"}],"version-history":[{"count":15,"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/posts\/1096\/revisions"}],"predecessor-version":[{"id":1794,"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/posts\/1096\/revisions\/1794"}],"wp:attachment":[{"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/media?parent=1096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/categories?post=1096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.gravitysmtp.com\/wp-json\/wp\/v2\/tags?post=1096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}