bvsmohan Posted January 24, 2010 Share Posted January 24, 2010 himy hosting company requires SMTP authentication to send emails. When i setup SMTP options nothing is happening, no error nor email working, but in few pages for example in send to a friend module when i send mail its redirecting to home page without giving successfully mail sent message.when i contacted with my hosting company regarding this they provided me with a script to send mail, it is working perfectly, code is belowas i am new to PHP and prestashop i am unable to find whats the problem, please help me in this regard, thanks code: <?php require_once "Mail.php"; $from = "Sachin Gupta "; $to = "Znet "; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "mail.sendgiftstowarangal.com"; $username = "[email protected]"; $password = "**********"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo(" " . $mail->getMessage() . ""); } else { echo(" Message successfully sent!"); } ?> Link to comment Share on other sites More sharing options...
mooshi Posted January 24, 2010 Share Posted January 24, 2010 for your username, just try the test without your .com string after in the configuration eg your username is not [email protected], it's just test. Is that how you have set it up? Link to comment Share on other sites More sharing options...
bvsmohan Posted January 25, 2010 Author Share Posted January 25, 2010 i used both types, with and without domain name but unable to send Link to comment Share on other sites More sharing options...
mooshi Posted January 25, 2010 Share Posted January 25, 2010 hi!what are your settings in the bois SSL enabled and what port no#? Link to comment Share on other sites More sharing options...
bvsmohan Posted January 25, 2010 Author Share Posted January 25, 2010 here is the screenshot of email settings Link to comment Share on other sites More sharing options...
mooshi Posted January 25, 2010 Share Posted January 25, 2010 ok problem is you need to have SSL enabled, not sure on port no# , but google uses 465. Sorry I never use smtp to be honest, because of the problem you are having. I always use mail and have never had a problem.see some here too....I think it depends on your hosthttp://www.prestashop.com/forums/viewthread/36284/#171780 Link to comment Share on other sites More sharing options...
bvsmohan Posted January 25, 2010 Author Share Posted January 25, 2010 KGal thanks for ur help,when i use phpmailer its sending message but its delivery was failed and when i contacted my hosting company they said mail needs to be authenticated to send, is there any way to authenticate sending mail when using phpmailer.and as i said in my first post the code which is provided by hosting company, which uses SMTP method working fine Link to comment Share on other sites More sharing options...
mooshi Posted January 25, 2010 Share Posted January 25, 2010 No! problem, wish you could find a solution thoughdo you have SSL with dedicated IP or just shared SSL? Link to comment Share on other sites More sharing options...
bvsmohan Posted January 25, 2010 Author Share Posted January 25, 2010 it is shared SSL,when i try to send to a friend option i observed that its neither giving "mail send successfully" or "error occurred" messages, its simply redirecting page to home page Link to comment Share on other sites More sharing options...
mooshi Posted January 25, 2010 Share Posted January 25, 2010 Is the error above using mail or smtp? I always though that you couldn't use shared SSL, but I could quite possibly be wrong. Has to be host problem....I don't have any solution sorry. Link to comment Share on other sites More sharing options...
mooshi Posted January 25, 2010 Share Posted January 25, 2010 http://www.prestashop.com/forums/viewthread/40914/help_configuration___use/total_stop_of_all_ps_emails_ps_or_ispMaybe try this solution, worth a shot! Link to comment Share on other sites More sharing options...
bvsmohan Posted January 26, 2010 Author Share Posted January 26, 2010 tried everything but no use,thanks for all the help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now