Jump to content

Archived

This topic is now archived and is closed to further replies.

suhy

SMTP Contribution - www.oscommerce.com/community/contributions,901

Recommended Posts

Yep, you're right. The forgotten password request email, etc. is being sent from qmail on the web server. I need to be sending from a non-local exchange server. The store's "extra order emails to" function is no longer working either.

 

In the classes/email.php code, which is correct:

 

// This is used as in the MAIL FROM: cmd

// It should end up as the Return-Path: header

$send_params['from'] = $from_addr;

 

OR

 

// This is used as in the MAIL FROM: cmd

// It should end up as the Return-Path: header

$send_params['from'] = $params['user'];

Use of $from_addr is correct.

Share this post


Link to post
Share on other sites

Also, in the classes/class.smtp.php code which is correct for sending through a non-local server:

 

function smtp($params = array()){

 

if(!defined('CRLF'))

define('CRLF', "\r\n", TRUE);

 

$this->authenticated = FALSE;

$this->timeout = 5;

$this->status = SMTP_STATUS_NOT_CONNECTED;

$this->host = "localhost";

$this->port = 25;

$this->helo = "localhost";

$this->auth = FALSE;

$this->user = "";

$this->pass = "";

$this->errors = array();

 

OR

 

function smtp($params = array()){

 

if(!defined('CRLF'))

define('CRLF', "\r\n", TRUE);

 

$this->authenticated = FALSE;

$this->timeout = 5;

$this->status = SMTP_STATUS_NOT_CONNECTED;

$this->host = "mail.mydomain.com";

$this->port = 25;

$this->helo = "mydomain.com";

$this->auth = FALSE;

$this->user = "";

$this->pass = "";

$this->errors = array();

Wendall,

 

The second is more correct; however, you do not need to modify that code assuming you are also using the email class that is part of the contribution. The above logic is initialization logic in the class constructor and is immediately followed by logic to override the defaults with the values passed in the $params variable which is constructed by the email class based on the admin email related configuration parameters.

 

Download the 11 June 2009 version of the contribution (the last one I posted) and reinstall the complete contribution.

 

Ben

Share this post


Link to post
Share on other sites

Ben,

 

Reinstalled 11 June 2009 version and now I'm back to the original problem. No account created email, no order confirmation, no forgotten password, and can't email directly from admin. However, the contact us inquiry form is working. Any other ideas?

Wendall

 

 

Wendall,

 

The second is more correct; however, you do not need to modify that code assuming you are also using the email class that is part of the contribution. The above logic is initialization logic in the class constructor and is immediately followed by logic to override the defaults with the values passed in the $params variable which is constructed by the email class based on the admin email related configuration parameters.

 

Download the 11 June 2009 version of the contribution (the last one I posted) and reinstall the complete contribution.

 

Ben

Share this post


Link to post
Share on other sites

Ben,

 

Reinstalled 11 June 2009 version and now I'm back to the original problem. No account created email, no order confirmation, no forgotten password, and can't email directly from admin. However, the contact us inquiry form is working. Any other ideas?

Wendall

Wendall,

 

I've no idea what is going on. If you don't mind, send me your email related configuration parameters in a PM (skip the password, I don't want to know). Also, let me know who's your hosting company.

 

Ben

Share this post


Link to post
Share on other sites

Hi Ben,

 

Can I get your input on this problem located here: http://forums.oscommerce.com/topic/352420-godaddy-email-smtp-google-questions/page__view__findpost__p__1485191

 

I'm on Godaddy and I'm facing the same problem, but I am not really happy using the proposed solution by eaochoac, so I was hoping you could help us Godaddy users with a real solution.

 

Sierra

Share this post


Link to post
Share on other sites

Hi Sierra,

 

I've posted a relay on the other thread.

 

You should not need to use eaochoac's proposed solution.

 

If the contribution is correctly installed, it works. You may want to use the last version of the contribution I posted (11 June 2009). I can't vouch for the later versions.

 

If you have any questions, let me know.

 

Ben

Hi Ben,

 

Can I get your input on this problem located here: http://forums.oscommerce.com/topic/352420-godaddy-email-smtp-google-questions/page__view__findpost__p__1485191

 

I'm on Godaddy and I'm facing the same problem, but I am not really happy using the proposed solution by eaochoac, so I was hoping you could help us Godaddy users with a real solution.

 

Sierra

Share this post


Link to post
Share on other sites

Hi and thanks for the contribution, it sorted my problem called "Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings". Obviously my host have blocked user nobody from sending email from their server to prevent the server IP gets blacklisted.

 

I just wanted to ask you how difficult would it be to add "X-Priority:" into header?


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

It's fairly easy to add extra mail headers, but not quite as easy as it should be (I'll explain in a moment). The function you want to modify is "send" routine in the email.php file. The function is located almost at the end of the file.

 

The send function takes the option parameter "headers" which by default is empty. Now you should be able to pass in any number of extra email headers via this parameter (and you can), but they are only passed when the contribution is configured to use the sendmail method of email delivery. Do to an oversight on my part, they option headers are not being passed the the SMTP delivery method. Something to fix...

 

So depending on what email method you have your site configured for, it may be as easy as adding the extra header to the send call or you will need to modify the send routine to add email header to the generated "From:, To: Subject: Date:" line for the SMTP method of communications.

 

Ben

 

Hi and thanks for the contribution, it sorted my problem called "Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings". Obviously my host have blocked user nobody from sending email from their server to prevent the server IP gets blacklisted.

 

I just wanted to ask you how difficult would it be to add "X-Priority:" into header?

Share this post


Link to post
Share on other sites

Due to the problem with "nobody" in the header while using sendmail method, I have changed to SMTP and your contribution was simple and working.

 

If we want to make sure that all of our email messages ARE being delivered, we have to make sure that the header looks like this:

 

From: Your Company <you@yourcompany.com>

Reply-To: reply@yourcompany.com

To: John Doe <john.doe@email.com>

 

The header also should contain:

Return-path: <your_return@yourcompany.com>

(envelope-from <you@yourcompany.com>)

 

You could also include:

X-Priority: 1 (or 2 or 3)

X-MSMail-Priority: High (or Low or Normal)

 

The above changes will minimize the possibility of the messages sent by the store being treated as spam.

 

If you could have a look at the smtp to be able to pass those headers, that would be great.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Thank you for the excellent, contribution, it worked perfectly for me. I would like to change the file permissions, so that they are not writeable, or changeable fromwithin the admin section, which file(s) do I have to change? And is 444 the correct permissions to give?

Share this post


Link to post
Share on other sites

Thank you for the excellent, contribution, it worked perfectly for me. I would like to change the file permissions, so that they are not writeable, or changeable fromwithin the admin section, which file(s) do I have to change? And is 444 the correct permissions to give?

Larry,

 

This contribution does not need anything unique with regards to file permissions. Use what you would normally use on your web server. A 444 permission on the files should work fine. The folders normally need a permission of 755 or 555 in order for the web server to operate correctly.

 

Ben

Share this post


Link to post
Share on other sites

Ben (or others),

 

I spent several hours trying to get this to work right... I finally got it working right minus one little problem.

 

My site uses Google Apps for Business for emails. The problem I am facing right now is when I perform a test email via the Contact Us page in the store, the email is showing from orders@mydomain.com and to order@mydomain.com. This is a problem because I cannot see the email address of the person who submitted the enquiry, it simply shows the my stores email as the To and From email. This was never a problem before I installed this contribution.

 

Do you have any idea why it is doing this and how I can fix it? Thank you in advance for the help!

Share this post


Link to post
Share on other sites

Hello,

 

I have applied this contribution but I cannot get it to work. The database was updated correctly and all the right details are in place but I don't see the debug output and no emails are sent from the site or the admin area.

Any ideas?

 

Many thanks in advance.

 

Angeliki

Share this post


Link to post
Share on other sites

Guys, it's fixed!!!!! For all those poor people trying to work this out, the solution for me was simple. i contacted my host after numerous days of trying to fix the problem and they told me that my host is mail.mydomain.com and not smtp.mydomain.com. That was it!!! There are many pages of comments and having a full time job and a broken website to fix doesn't allow me to browse throught he whole forum so maybe this solution has been mentioned before but it doesn't hurt mentioning it again!

Share this post


Link to post
Share on other sites

Hi All,

 

I have the same problem as Wendall had two years ago. Mails are being sent from the shop (contact us) but not from the admin area (order mails, status mails, manual mails etc). I had it working with the PHPMailer contribution but I switched to this contribution because I want to be able to log the mails sent out from the server to a file so I can check what mails leave the server. I recently got banned from my ISP after hackers used my server to send thousands of mails without me knowing it.

 

So, were you able to solve the problem that Wendall had?

 

Thanks,

Johan


Specialization is for insects...

Share this post


Link to post
Share on other sites

×