[{"data":1,"prerenderedAt":143},["ShallowReactive",2],{"article-php-send-mail":3,"authors":127},{"id":4,"title":5,"author":6,"body":7,"date":117,"description":118,"extension":119,"meta":120,"navigation":121,"path":122,"seo":123,"stem":124,"thumbnail":125,"__hash__":126},"article\u002Farticle\u002Fphp-send-mail.md","Php Send Mail","ashwin",{"type":8,"value":9,"toc":114},"minimark",[10,14,17,35,38,44,61,64,83,86,89,101,104,107,110],[11,12,13],"p",{},"After installing sendmail on ubuntu server 14.04 \u002F 16.04 , I tried sending mail from my php script and it was painfully slow. I thought I had not configured my apache \u002F nginx properly. Me being a noob at this, tried to delete the snapshot and reinstalled with ubuntu 14.04 (earlier one being ubuntu 16). Still the issue persisted. After a lot of googling I kind of figured a solution.",[11,15,16],{},"Initially determine the hostname of your server by typing",[18,19,24],"pre",{"className":20,"code":21,"language":22,"meta":23,"style":23},"language-bash shiki shiki-themes material-theme-darker","hostname\n","bash","",[25,26,27],"code",{"__ignoreMap":23},[28,29,32],"span",{"class":30,"line":31},"line",1,[28,33,21],{"class":34},"s5Dmg",[11,36,37],{},"This will reveal your hostname.",[11,39,40,41],{},"Then go to ",[25,42,43],{},"\u002Fetc\u002Fhosts",[18,45,47],{"className":20,"code":46,"language":22,"meta":23,"style":23},"sudo vi \u002Fetc\u002Fhosts\n",[25,48,49],{"__ignoreMap":23},[28,50,51,54,58],{"class":30,"line":31},[28,52,53],{"class":34},"sudo",[28,55,57],{"class":56},"sfyAc"," vi",[28,59,60],{"class":56}," \u002Fetc\u002Fhosts\n",[11,62,63],{},"Modify the line with IP to read as",[18,65,67],{"className":20,"code":66,"language":22,"meta":23,"style":23},"127.0.0.1    localhost localhost.localdomain ashwin\n",[25,68,69],{"__ignoreMap":23},[28,70,71,74,77,80],{"class":30,"line":31},[28,72,73],{"class":34},"127.0.0.1",[28,75,76],{"class":56},"    localhost",[28,78,79],{"class":56}," localhost.localdomain",[28,81,82],{"class":56}," ashwin\n",[11,84,85],{},"(where “ashwin” is my server’s hostname, you should add your server’s hostname — duh!)",[11,87,88],{},"Finally I ran",[18,90,92],{"className":20,"code":91,"language":22,"meta":23,"style":23},"sudo sendmailconfig\n",[25,93,94],{"__ignoreMap":23},[28,95,96,98],{"class":30,"line":31},[28,97,53],{"class":34},[28,99,100],{"class":56}," sendmailconfig\n",[11,102,103],{},"Answer Y to all the questions asked to rebuild\u002Freload sendmail configuration..",[11,105,106],{},"That’s it, Send Mail started working !",[11,108,109],{},"Hope this helps for people who struggled with installing a new server in Digital Ocean \u002F AWS and trying to send mail!",[111,112,113],"style",{},"html pre.shiki code .s5Dmg, html code.shiki .s5Dmg{--shiki-default:#FFCB6B}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sfyAc, html code.shiki .sfyAc{--shiki-default:#C3E88D}",{"title":23,"searchDepth":115,"depth":115,"links":116},2,[],"2017-04-07T08:01:36.093Z","Fix slow PHP send mail on server - Digital Ocean, AWS","md",{},true,"\u002Farticle\u002Fphp-send-mail",{"title":5,"description":118},"article\u002Fphp-send-mail","\u002Fimg\u002Fphp-send-mail.png","YZ5Nm6ttdnHT36TYVD0oxdbUqs6aSjffjNl7l3jbIuA",{"id":128,"extension":129,"meta":130,"stem":141,"__hash__":142},"author\u002Fauthor\u002FauthorDetails.json","json",{"body":131},[132,136],{"id":6,"fullName":133,"description":134,"image":135},"Ashwin K Shenoy","Hi! I am Ashwin, an Software Engineer and Consultant based out of Bengaluru, India.","https:\u002F\u002Fsimpletech.xyz\u002Fimg\u002Fauthor\u002Fashwin.jpg",{"id":137,"fullName":138,"description":139,"image":140},"paul","Paul Shan","Hello! I am Paul, a front end engineer and consultant based out of Bengaluru, India.","https:\u002F\u002Fashwinshenoy.com\u002Fimg\u002Fashwin2.jpg","author\u002FauthorDetails","k8atXxcwAcv_rjC8llPba18X62upiKWYGU5dL4-S4lw",1782187479869]