Nicola-H Posted August 27, 2006 Share Posted August 27, 2006 I'm not getting any emails from my OSCommerce installation. My hosting company (Fasthosts) have an outgoing mailserver address which is different to the domain address. All incoming mail is handled with POP accounts ([email protected]), but outgoing mail goes through smtp.fasthosts.co.uk. I do not have access to the php.ini file as I'm on a shared Windows server. I've had a look through the forums and it seems that a lot of people with a similar setup are having the same problem but I can't see a solution to it. Isn't there somewhere I can hard-code the outgoing mailserver? I can't see anything but then my knowledge of PHP is pretty appalling. If not, and I use PayPal and NoChex as payment methods, will I get customer order details in the emails from them? Or is there somewhere I can view details of orders? Thanks :) Link to comment Share on other sites More sharing options...
Nicola-H Posted August 29, 2006 Author Share Posted August 29, 2006 Is this issue just something that can't be resolved? I can't help thinking the answer must be a simple one, but at the moment I'm stuck with a website that's unusable as I won't get details of any orders, have an unusable contact form, and can not use the admin section to contact registered customers. Isn't there a workaround in whichever bit of the site specifies the outgoing mailserver without having to access the php.ini file? Maybe I could use a different PHP mailing script like PEAR mail where I can specify the server? I have no idea which files are used to send the emails so if someone could even help me with that bit I might be able to at least try and resolve the problem myself. Link to comment Share on other sites More sharing options...
Nicola-H Posted August 29, 2006 Author Share Posted August 29, 2006 I know I'm talking to myself here, but maybe if I carry on, someone might be tempted to join in at some point :) I tried installing the Pear email contribution which is supposed to add an option to specify the outgoing mailserver, but now I just get this error when I try to access the admin pages: "Fatal error: Cannot redeclare tep_db_connect() (previously declared in e:\domains\v\visionquest.org.uk\user\htdocs\catalog\admin\includes\functions\database.php:13) in e:\domains\v\visionquest.org.uk\user\htdocs\catalog\admin\includes\functions\database.php on line 13" Has anyone else tried to install this contribution? Or got around this problem? Please? Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2006 Share Posted September 3, 2006 Isn't there somewhere I can hard-code the outgoing mailserver? The following code will temporarily override the php.ini SMTP setting: ini_set('SMTP', 'smtp.fasthosts.co.uk'); You could, for example, insert it before calling mail(....); Link to comment Share on other sites More sharing options...
Nicola-H Posted September 17, 2006 Author Share Posted September 17, 2006 Thanks for that... I'm not sure where to add the line though. There's a tep_mail function in the general.php file in functions which seems to handle the email from the contact form at least, but there is no 'mail(...)' command in there. I tried putting it in before this line: $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); But that just blows up all the pages with headers errors: Warning: Cannot modify header information - headers already sent by (output started at e:\domains\v\visionquest.org.uk\user\htdocs\catalog\includes\functions\general.php:5) in e:\domains\v\visionquest.org.uk\user\htdocs\catalog\includes\functions\general.php on line 983 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at e:\domains\v\visionquest.org.uk\user\htdocs\catalog\includes\functions\general.php:5) in e:\domains\v\visionquest.org.uk\user\htdocs\catalog\includes\functions\sessions.php on line 68 Even if I edit the file again the errors stay there until I upload the original version. I'm still no nearer to getting the emails to work which means I still can't process any orders. Can you give me a clue as to which files I need to edit and how in order to get this to work? Thanks :-) Link to comment Share on other sites More sharing options...
Guest Posted September 18, 2006 Share Posted September 18, 2006 Thanks for that... I'm not sure where to add the line though. There's a tep_mail function in the general.php file in functions which seems to handle the email from the contact form at least, but there is no 'mail(...)' command in there.... Can you give me a clue as to which files I need to edit and how in order to get this to work? I made the change in catalog/includes/classes/email.php, line 519, right before the following: if (EMAIL_TRANSPORT == 'smtp') { return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); } Link to comment Share on other sites More sharing options...
Nicola-H Posted September 19, 2006 Author Share Posted September 19, 2006 I tried putting that line in but I am still not getting any of the site emails. Is there some way of finding out where in the code it's going wrong? I'm used to ASP and JMail, and if something breaks during the mail send I get an error. This is just behaving as though the mail is sent, and nothing is arriving at the other end. I've tried using different email addresses and turning spam filters off etc. - the site is just not generating anything. Any other ideas? Thanks, N Link to comment Share on other sites More sharing options...
jkmentertainment Posted October 6, 2006 Share Posted October 6, 2006 :D Hi Nicola_H, I have had the same headache with the email function in OSC, but I seem to have got this all working perfectly now. All fasthosts customers that have webspace and domain registration (via UKREG a FASTSHOSTS child company) are entitled to send email via fasthosts smtp servers. The reason why many people using shared hosting are having difficulties is due to the SPAM crack down and the introduction of REVERSE IP LOOKUP, which is where all providers and ISP's are now checking the domain name that the email has come from and resolving the domain name to the senders IP address. If the IP address matches the domain then the email is accepted else it is rejected as suspected SPAM. If you have registered your domain with fasthosts, and as long as you have webspace with them as well then your domain is entered into their reverse lookup tables as accepted, which bypasses this level of SPAM checking. here is how I have done it. ******** First off backup your catalog\includes\classes\email.php file. ********** Then find line 519 which should be if (EMAIL_TRANSPORT == 'smtp') { return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); } and replace with if (EMAIL_TRANSPORT == 'smtp') { ini_set("sendmail_from", $from); return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); } ******** Then save the file ************ PLEASE ALSO ENSURE YOU HAVE SET THE 'E-MAIL TRANSPORT METHOD' TO SMTP IN ADMINISTRATION -> E-MAIL OPTIONS ON OSC ADMIN PAGES. As soon as I corrected this script everything on the emails started working perfectly. I hope this resolves your issues as well. Link to comment Share on other sites More sharing options...
Nicola-H Posted October 9, 2006 Author Share Posted October 9, 2006 Matthew, you're a genius :D Thank you so much for taking the time to post this - it now works perfectly and I don't have to log into the admin system every morning to get details of any orders. Link to comment Share on other sites More sharing options...
Crystina Posted October 9, 2006 Share Posted October 9, 2006 Matthew, you're a genius :D Thank you so much for taking the time to post this - it now works perfectly and I don't have to log into the admin system every morning to get details of any orders. Ditto! Thanks so much for this... I searched everywhere. My email now works perfectly! In fact, it just sent me order notifications from all of the ones it had missed. Thanks again! Link to comment Share on other sites More sharing options...
jkmentertainment Posted October 9, 2006 Share Posted October 9, 2006 Matthew, you're a genius :D Thank you so much for taking the time to post this - it now works perfectly and I don't have to log into the admin system every morning to get details of any orders. Thank you, I have also got SSL secure connections working with shared ssl (again fasthosts) and this was too a headache, so if you need info on how to do this then just let me know and maybe I can help. Matt Link to comment Share on other sites More sharing options...
fborille Posted October 18, 2006 Share Posted October 18, 2006 People, How can i send emails using smtp that's in another machine of course and needs authentication ?? I can't see where in the code i can put my host and login info :/ Can someone help me ? Thanks Fabio Link to comment Share on other sites More sharing options...
kaotikevl Posted October 31, 2006 Share Posted October 31, 2006 I'm not using fathost or whatever, but i am using a shared hosting service and i have tried to do all of these things and I still cannot get it to work. Are there any other ideas? Any other threads i have missed? I've been searching the forums and i can't find anything! It tells me that my email is going through, but the user does not receive any emails. PLEASE HELP! Link to comment Share on other sites More sharing options...
jkmentertainment Posted October 31, 2006 Share Posted October 31, 2006 I'm not using fathost or whatever, but i am using a shared hosting service and i have tried to do all of these things and I still cannot get it to work. Are there any other ideas? Any other threads i have missed? I've been searching the forums and i can't find anything! It tells me that my email is going through, but the user does not receive any emails. PLEASE HELP! Hi There, It does not matter who your host is their should always be a way with any half decent host. If you can let me know who your host is then I can see if I can find a solution for you, as all hosts do things differently. Regards Link to comment Share on other sites More sharing options...
kaotikevl Posted November 4, 2006 Share Posted November 4, 2006 Hi There, It does not matter who your host is their should always be a way with any half decent host. If you can let me know who your host is then I can see if I can find a solution for you, as all hosts do things differently. Regards Thanks for the help, I am using Hosted Today. http://www.hostedtoday.com Link to comment Share on other sites More sharing options...
Emilytw88 Posted May 4, 2011 Share Posted May 4, 2011 I am having the same trouble with my email server setting? Can anyone tell me under which folder and php file that I can set the SMTP setting for my website? I am using One.com as my hosting company. Same as Nicola that I cannot access my php.ini file either. Thanks. -Emily Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.