Schizolocal Posted November 22, 2013 Posted November 22, 2013 I'm having a problem with sending email (my local testing server is Windows but my live site is Unix, so I am trying to juggle the use of the two). On my Windows server, I cannot successfully send via smtp, and it seems that the variable EMAIL_TRANSPORT is blank. The same test of the value of this variable occurs 4 times on my site..viz: if (EMAIL_TRANSPORT == 'smtp') { etc ..but I cannot find anywhere that actually sets it. Am I missing something or have I deleted a file by mistake? Thanks Stuart
burt Posted November 22, 2013 Posted November 22, 2013 admin > configuration > email options > email transport method
Schizolocal Posted November 23, 2013 Author Posted November 23, 2013 Thanks for the reply, but it's not quite what I wanted. I know how to use the configuration tool in Admin, but I am at a loss, at the php level, to work out how the variable EMAIL_TRANSPORT is given a value, which, at the time it is tested, is always blank. I think there is something I do not understand about the php referencing mechanism, since the variable is a value in the Configuraton table of the database. But how does the php statement use that? Stuart
Chris H Posted November 23, 2013 Posted November 23, 2013 As you say, EMAIL_TRANSPORT is in the configuration file. It is in the configuration_key column, at about line 140 . The corresponding entry in the configuration_value column should be 'sendmail' (without the quotes). Many osC files include the line require('includes/application_top.php'); and application_top in turn includes // set the application parameters $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } This creates a great many 'defines', pretty much like those in catalog\includes\languages\english.php and so php will just replace 'EMAIL_TRANSPORT' with 'sendmail'.
Chris H Posted November 23, 2013 Posted November 23, 2013 I meant of course 'in the configuration table', not 'in the configuration file'. Sorry about that.
Schizolocal Posted November 24, 2013 Author Posted November 24, 2013 That's exactly the piece of information I was missing - thanks so much. Stuart
burt Posted November 24, 2013 Posted November 24, 2013 Thanks for the reply, but it's not quite what I wanted. Are you sure that is not what you wanted ? By setting this in the admin area, you change data into the database => you get EMAIL_TRANSPORT defined from within the database. Think of it as a "key" and a "value". EMAIL_TRANSPORT => sendmail As @@Chris H states, this is also true for items in the language files, again, keys and values: define('HEADER_TITLE_TOP', 'Administration'); key: HEADER_TITLE_TOP Value: Administration echo HEADER_TITLE_TOP outputs: Administration However, if you are developing on localhost, it's pointless trying to get email to work - total pain in the hoop - just turn off emails in the localhost DB and do without them.
Schizolocal Posted November 27, 2013 Author Posted November 27, 2013 @@burt Well, in a way it was what I wanted, except that the missing information that I needed was the loop Define in application_top. (It is true that the value gets assigned when I use the admin tool, but I just couldn't find the place where it was defined) I am using my own Windows server as a webserver (using Fastream IQ) for testing, but my live application will be hosted on a Unix machine (outside of my control). I have previously, with a different project, managed to get email to work on both, switching smtp and sendmail depending on the context. I was trying to build that into my oscommerce project too, but I thought I needed to know where the definition took place. When I didn't understand how the variable was defined, I was a bit stymied. Thanks for your help, all - I'm happy now. (You might ask why I am testing on a local machine - the answer is in my address. I live on the island of St.Helena in the middle of South Atlantic Ocean, at the end of a very thin satellite link over which extremely expensive bytes pass. I cannot afford to be profligate with my uploads and downloads, so testing locally is a financial imperative. The hosted live site will be on YOUR end; my intended customers will surely thank me for that!) Stuart
Recommended Posts
Archived
This topic is now archived and is closed to further replies.