By miteshsoni
I am just making a very simple use of mail () function but it is also not working. the value of function is returning true. I can receive mail on my email if i upload this file to another server but when I use it on my droplet it don’t works.
my code is
<?php $to=“contact@xyz.com”; $subject=“subject”; $mail_body=“Dear sir, message”; $from=“myemail@mydomain.x”;
if (mail ($to,$subject,$mail_body,$from))
{ echo ‘mail delivered successfully’; } else { echo ‘problem delivering mail’; }
?>
it is working on other website as I had tried it. but not working on digital ocean droplet so someone please help me our sorting this problem.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
http://stackoverflow.com/questions/8803994/php-mail-not-working-for-some-reason <br> <br>Try installing sendmail. If you are on Ubuntu ‘sudo apt-get install sendmail’ <br> <br>PHPMailer with a gmail account is more likely to work consistently though. http://phpmailer.worxware.com/?pg=examplebgmail
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.