-2

I am using php mail function for sending mails.It works in several server.but not working in particular server.May be its server issue.How can i resolve it and sending mail in that server or how to redirect to one server to another and perform php mail function.Anyone please help me...

Iyrin
  • 17
  • 9

3 Answers3

1

Use phpmailer to send mail or check configuration in php.ini is enabled SMPTP/SSL extension file

Please check particular server port is open?

If use send mail using in gmail(Please check 587 or 465 ).

Another site check SMTP/TCP/openssl extension in enabled in this server?

I would suggest you to use send mail using perl

Please visit this link more info

Send email using the GMail SMTP server from a PHP page


php.ini & SMTP= - how do you pass username & password

Community
  • 1
  • 1
Hiren Bhut
  • 1,166
  • 1
  • 13
  • 19
0

i had an issue like this on a shared server from hostpapa and had to add this line to my code.

ini_set("SMTP", smtp.yourmailserver.com);

also make sure you specify the mail headers

Louis Loudog Trottier
  • 1,367
  • 13
  • 26
  • $to = $myemail; $email_subject = "Feedback Form from: $name"; $email_body = "You have received a new message. ". " Here are the details:\n Name: $name \n Email: $email_address \n". " \n Message:$message \n "; $headers = "From: $email_address\n"; $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); //redirect to the 'thank you' page echo ""; – Iyrin May 30 '15 at 04:42
  • I am using this code ... – Iyrin May 30 '15 at 04:42
0

It could be a lot of possibilites actually. Often, you will send an e-mail with php mail function and you will get no errors but your e-mail will be blocked. Plus, if you want a HTML-based email it's pretty hard to do this with mail(), so please please, use something better like PHPMailer and then try SMTP like mailchimp or even mandrillapp.

Matthieu Boisjoli
  • 1,057
  • 2
  • 11
  • 17
  • I have tried with all maiiling functions codes. But neither works. I copy this codes and tests in another one server. it works. I cannot understand the problem. I have contacted server people they told me to activate email configration from cpanel. How to do that? please help me – Iyrin May 30 '15 at 04:47
  • i am using webhostbox server – Iyrin May 30 '15 at 04:48
  • You should consider to use PHPMailer and use SMTP mandrillapp, it's very easy to configure. You don't need to change settings in CPanel, it's supposed to be all set already. If "server people" told you that, you should probably think about changing host!! – Matthieu Boisjoli May 30 '15 at 04:56