1"use strict";(self.webpackChunkphpvms_docs=self.webpackChunkphpvms_docs||[]).push([[1223],{65330(e,n,i){i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>t,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"config/email","title":"Email","description":"It is recommended to use a 3rd party service for sending email. They usually","source":"@site/versioned_docs/version-v7.x/config/email.md","sourceDirName":"config","slug":"/config/email","permalink":"/config/email","draft":false,"unlisted":false,"editUrl":"https://github.com/phpvms/docs/tree/master/versioned_docs/version-v7.x/config/email.md","tags":[],"version":"v7.x","frontMatter":{"id":"email"},"sidebar":"docs","previous":{"title":"Config Language","permalink":"/config/language"},"next":{"title":"Optimizing","permalink":"/config/optimizing"}}');var o=i(74848),r=i(28453);const t={id:"email"},a="Email",l={},c=[{value:"SMTP Configuration",id:"smtp-configuration",level:3},{value:"Mailgun Configuration",id:"mailgun-configuration",level:3},{value:"Postmark Configuration",id:"postmark-configuration",level:3},{value:"SES Configuration",id:"ses-configuration",level:3},{value:"Debugging",id:"debugging",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"email",children:"Email"})}),"\n",(0,o.jsx)(n.p,{children:'It is recommended to use a 3rd party service for sending email. They usually\noffer SMTP support, and great logging and analytics. Especially on a shared\nhost, where email is locked down, and a "naughty neighbor" can quickly get the\nserver/IP you\'re emailing from blacklisted. I highly recommend using a service\nover SMTP, because SMTP slows response times down.'}),"\n",(0,o.jsx)(n.p,{children:"These services are supported by Laravel natively;"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.a,{href:"http://www.mailgun.com",children:"Mailgun"})," - Free, up to 10k messages/month"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.a,{href:"https://postmarkapp.com",children:"Postmark"})," - Tell their support you were referred for\na free month"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.a,{href:"https://aws.amazon.com/ses/",children:"Amazon SES"})," - Super cheap, free if you're using\nEC2"]}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"warning",children:(0,o.jsxs)(n.p,{children:["Do not forget cleaning application cache after editing ",(0,o.jsx)(n.code,{children:".env"})," variables.\nOtherwise, settings you defined/altered will not be loaded."]})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h3,{id:"smtp-configuration",children:"SMTP Configuration"}),"\n",(0,o.jsxs)(n.p,{children:["To configure SMTP, in your ",(0,o.jsx)(n.code,{children:".env"})," file, you need to configure the following\noptions:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",metastring:'title=".env"',children:"MAIL_MAILER=smtp\nMAIL_FROM_NAME='phpvms No-Reply'\nMAIL_FROM_ADDRESS='[email protected]'\nMAIL_HOST=\nMAIL_PORT=\nMAIL_ENCRYPTION=\nMAIL_USERNAME=\nMAIL_PASSWORD=\n"})}),"\n",(0,o.jsx)(n.p,{children:"For detailed settings about host, port and encryption details please check your\nhosting control panel (or VPS). These settings are not generic and can differ\nbetween hosting companies, even on a custom VPS these settings are local to your\ninstall (packages installed etc.) Therefore there a no generic examples for SMTP\nand mail settings."}),"\n",(0,o.jsx)(n.h3,{id:"mailgun-configuration",children:"Mailgun Configuration"}),"\n",(0,o.jsxs)(n.p,{children:["To use Mailgun, set your ",(0,o.jsx)(n.code,{children:".env"})," like:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",metastring:'title=".env"',children:"MAIL_MAILER=mailgun\nMAILGUN_DOMAIN='your mailgun domain'\nMAILGUN_SECRET='your mailgun secret',\n"})}),"\n",(0,o.jsx)(n.h3,{id:"postmark-configuration",children:"Postmark Configuration"}),"\n",(0,o.jsxs)(n.p,{children:["To use Postmark, set your ",(0,o.jsx)(n.code,{children:".env"})," like:"]}
1),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",metastring:'title=".env"',children:"MAIL_MAILER=postmark\nPOSTMARK_TOKEN='your postmark token'\n"})}),"\n",(0,o.jsx)(n.h3,{id:"ses-configuration",children:"SES Configuration"}),"\n",(0,o.jsxs)(n.p,{children:["To use SES, set your ",(0,o.jsx)(n.code,{children:".env"})," like:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",metastring:'title=".env"',children:"MAIL_MAILER=ses\nAWS_ACCESS_KEY_ID='key id'\nAWS_SECRET_ACCESS_KEY='access key'\nAWS_DEFAULT_REGION='the region if not us-east-1'\n"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h2,{id:"debugging",children:"Debugging"}),"\n",(0,o.jsxs)(n.p,{children:["For debugging mail, you can use the service ",(0,o.jsx)(n.a,{href:"https://mailtrap.io",children:"mailtrap.io"}),".\nMail-trail will show all of the incoming and outgoing email in an inbox, so you\ncan test registrations, accepts, etc. It will provide you Laravel-specific\nconfiguration, which looks something like:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",metastring:'title=".env"',children:"MAIL_MAILER=smtp\nMAIL_FROM_NAME='phpvms Admin'\nMAIL_FROM_ADDRESS='[email protected]'\nMAIL_HOST=smtp.mailtrap.io\nMAIL_PORT=2525\nMAIL_ENCRYPTION=tls\nMAIL_USERNAME='as provided'\nMAIL_PASSWORD='as provided'\n"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},28453(e,n,i){i.d(n,{R:()=>t,x:()=>a});var s=i(96540);const o={},r=s.createContext(o);function t(e){const n=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:t(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.