Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sending e-mails from forms


knifeman

Recommended Posts

Hello,

 

My host informed me that some e-mails will not go through to an ISP if the return path is from [email protected]

 

I have my real e-mail address in the admin section, but enquiries sent from the website have [email protected] in the return path if you click view>options and read the header info of an e-mail.

 

Where in OSC do I change this return path to my e-mail address?

 

Tim

Link to comment
Share on other sites

  • 1 month later...
Please forgive the bump. I still have no idea where to change this information.

 

I posted the same issue on another thread and haven't had any responses.

 

Was your installation done trough Fantastico by any chance? My hosting service thinks that

resinstalling will solve the problem, but I don't believe that is the case. AS my store is very heavily customized, this will only cause a boatload of problems.

 

From what I can see, OSCommerce's email functions were not configured for return or reply to headers and so the mail programs are injecting "nobody" as a default, and that seems to be what is causing the problem.

Link to comment
Share on other sites

I posted the same issue on another thread and haven't had any responses.

 

Was your installation done trough Fantastico by any chance? My hosting service thinks that

resinstalling will solve the problem, but I don't believe that is the case. AS my store is very heavily customized, this will only cause a boatload of problems.

 

From what I can see, OSCommerce's email functions were not configured for return or reply to headers and so the mail programs are injecting "nobody" as a default, and that seems to be what is causing the problem.

Yes I installed with fantastico. My store is also heavily modified and I will not reinstall. My host never offered a suggestion on how to fix the problem. If you ever find an answer please let us know.

 

Tim

Link to comment
Share on other sites

Yes I installed with fantastico. My store is also heavily modified and I will not reinstall. My host never offered a suggestion on how to fix the problem. If you ever find an answer please let us know.

 

Tim

 

I can't believe these hosting services would do this without adequate notice.

 

I've been doing quite a bit of research, and my guess is that OScommerce is not setup to sent the return-path header, so the agent defaults to [email protected] (the mail relay).

 

So it should be a simple matter of adding the return path header from OSC. How to do this is what I am trying to figure out this afternoon, unless someone else would be so kind as to provide an already devised solution (no doubt there are a fair number of people like us with this same problem).

 

The key is probably somewhere in the classes/email.php and or functions/general.php, or possibly the individual files requiring tep_mail.

 

If I can figure this out I'll be sure to let you know. If you hear of anything I would appreciate you letting me know as well.

 

Take care

Link to comment
Share on other sites

  • 1 month later...

I am having this problem as well. Messages from my osCommerce site are not getting delivered to AOL accounts.

 

Did anybody figure out how to modify the osCommerce mail code so that header return value isn't set to "nobody"?

Link to comment
Share on other sites

I am having this problem as well. Messages from my osCommerce site are not getting delivered to AOL accounts.

 

Did anybody figure out how to modify the osCommerce mail code so that header return value isn't set to "nobody"?

 

Hi Zmaster.

 

I didn't figure out how to add the return path in the header, but it wasn't necessary after all. My hosting service changed the configuration on their end to default to something different, and that seems to have fixed things. This problem appears to have been around for a while so your hosting service should know about the fix or be able to figure it out.

 

AJ

Link to comment
Share on other sites

Hi Zmaster.

 

I didn't figure out how to add the return path in the header, but it wasn't necessary after all. My hosting service changed the configuration on their end to default to something different, and that seems to have fixed things. This problem appears to have been around for a while so your hosting service should know about the fix or be able to figure it out.

 

AJ

Quite ironic. I started this thread because my host told me I need to change the 'nobody' part. Now it seems the solution is something they need to do on their end.

Link to comment
Share on other sites

Quite ironic. I started this thread because my host told me I need to change the 'nobody' part. Now it seems the solution is something they need to do on their end.

 

My host (HostGator) is taking the position that this is my problem and I need to modify osCommerce to set the headers properly.

 

I've found a few threads that discuss approaches for this on the osCommerce board here, but they all seem to be of the "this approach should work" variety instead of anybody reporting exactly what changes they made and that it worked.

 

On the other hand I have seen several people metion that their web host updated sendmail in order to fix the problem.

 

Since my host is taking the position that I need to address this in osCommerce, I'm wondering if there are any folks out there that have succesfully done this and can offer advice.

 

Thanks!

Link to comment
Share on other sites

This is a major problem for me as well. I've just spent 20 hours modifying and installing a cart for a client and can't get past this AOL issue.

 

Thing is.....aol users get the "welcome" email after creating an account.....but nothing else after that.

 

SOS!

Link to comment
Share on other sites

I was finally able to solve this problem by modifying the send() function in includes/classes/email.php and admin/includes/classes/email.php. There is a fifth parameter to the mail() function that can be used to specify a return path value.

 

In the osCommerce email class' send() function, search for the "EMAIL_TRANSPORT" conditional. The else here contains the code for the sendmail call.

 

Change this call to the following:

 

return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), '-f' . $from_addr);

 

The "-f" option is added as the last parameter with the from address of your osCommerce site.

 

Once I did this all my notification emails started being accepted by AOL. There was no longer a Return-path value of "[email protected]" that was causing AOL to identify the messages as spam.

 

I hope this helps!

Link to comment
Share on other sites

I was finally able to solve this problem by modifying the send() function in includes/classes/email.php and admin/includes/classes/email.php. There is a fifth parameter to the mail() function that can be used to specify a return path value.

 

In the osCommerce email class' send() function, search for the "EMAIL_TRANSPORT" conditional. The else here contains the code for the sendmail call.

 

Change this call to the following:

 

return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), '-f' . $from_addr);

 

The "-f" option is added as the last parameter with the from address of your osCommerce site.

 

Once I did this all my notification emails started being accepted by AOL. There was no longer a Return-path value of "[email protected]" that was causing AOL to identify the messages as spam.

 

I hope this helps!

 

Okay..I am not that php savy, so I apologize. Do I just add this coding to that page or am I replacing something that is currently on those pages?

 

Thanks in advance.

Link to comment
Share on other sites

Okay..I am not that php savy, so I apologize. Do I just add this coding to that page or am I replacing something that is currently on those pages?

 

Thanks in advance.

Find these lines:

 

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));

Change the last line like so... (adding the part in red)

 

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), '-f' . $from_addr);

 

The file to be changed is /includes/classes/email.php. It's found twice, once in catalog and again in admin. This solution is correct.

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Link to comment
Share on other sites

Found a solution!

 

This works for me:

 

look in email.php (there is one in catalog/includes/classes and one in catalog/admin/includes/classes)

 

Find this:

 

	  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 {

 

 

add this line in the white space BEFORE that:

 

ini_set("sendmail_from", "you@your_hosted_domain.com");

 

so that it looks like this:

 

ini_set("sendmail_from", "you@your_hosted_domain.com"); 
  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 {

 

This is why:

On a Windows based server it is necessary to set the "sendmail_from" address explicitly in the PHP.ini file. This will properly set the Return-Path variable in the header and is not necessarily the FROM address displayed on an email address. If the Return-Path is not specified, the email may be considered spam or malformed by most hosts. Especially on common free email servers. Since most hosts, including us, will not provide you with direct access to the PHP.ini file, you will need to set it in your script directly. Additionally, it would be incorrect for the host to specify a generic email address.

 

I posted this as well here:

 

http://www.oscommerce.com/forums/index.php?sho...=0entry831539

 

and here:

 

http://creloaded.com/Forums/viewtopic/p=43934.html#43934

 

It worked for me!

 

Thanks for the replies, and I hope that this helps!

 

swtummers

Link to comment
Share on other sites

I tried both these methods but I still get

 

From: nobody@.... on behalf of sales@......

 

So if you click reply then it replies to the sales@... so that is fine.

 

But I am finding the same problem that aol and others will not let these messages through.

Is there anything I can do to get rid of that "From: nobody@... on behalf of sales@..."

and just get it to say

"From Sales@..."

 

??

Thank you

Link to comment
Share on other sites

I was finally able to solve this problem by modifying the send() function in includes/classes/email.php and admin/includes/classes/email.php. There is a fifth parameter to the mail() function that can be used to specify a return path value.

 

In the osCommerce email class' send() function, search for the "EMAIL_TRANSPORT" conditional. The else here contains the code for the sendmail call.

 

Change this call to the following:

 

return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), '-f' . $from_addr);

 

The "-f" option is added as the last parameter with the from address of your osCommerce site.

 

Once I did this all my notification emails started being accepted by AOL. There was no longer a Return-path value of "[email protected]" that was causing AOL to identify the messages as spam.

 

I hope this helps!

 

I think the solution from swtummers is a one for Windows servers. For shared Linux hostings the one from 'zmaster' (quoted above) worked for me like a charm. My problem was that none of the emails were getting trhough to AOL. And this fixed it right up.

People dont change, people realize.

Link to comment
Share on other sites

  • 4 weeks later...

Zmsters solution worked like a charm for my site. I have it installed for a client's site and made sure to use zmaster's fix for it. However I seem to have a twist on this issue with aol:

 

The customer registers for an account and gets a welcome email on aol. Great!

They place an order....never receive an order confirmaiton email.

 

The cart is located at http://tekrispower.com/inverters

 

Any help would be greatly appreicated

Link to comment
Share on other sites

Zmsters solution worked like a charm for my site. I have it installed for a client's site and made sure to use zmaster's fix for it. However I seem to have a twist on this issue with aol:

 

The customer registers for an account and gets a welcome email on aol. Great!

They place an order....never receive an order confirmaiton email.

 

The cart is located at http://tekrispower.com/inverters

 

Any help would be greatly appreicated

 

I guess I neglected to mention that even though the solutions from Zmster worked for me, it worked in teh following manner: The first time a given AOL user receives an email from osC it stilla rives into the AOL uder's Spam mailbox and after they have chosen to accept emails from my domain name all emails that come tehreafter get straight to the main mailbox, as they should. I shoud also mention taht I have only tested with my own AOL account.

People dont change, people realize.

Link to comment
Share on other sites

Okay, let me update this:

 

Welcome email: received

Order confirm email: Not received:

Email from admin contact form: Received.

 

Any thoughts?

Link to comment
Share on other sites

I've set up a fake test customer account using my AOL email addy as theirs. Never received the Welcome Email. Never received the Order Process/Confirmation email either.

 

I set up another fake test customer (set up as out of state to make sure they wouldn't get taxed) and used one of my myway.com email addresses. Got the Welcome Email and Order Process/Confirmation email just fine.

 

There are no emails in the AOL spam folder either.

 

What do I need to do so that any of my AOL customers will get any emails from me! *grins*

Link to comment
Share on other sites

I've set up a fake test customer account using my AOL email addy as theirs. Never received the Welcome Email. Never received the Order Process/Confirmation email either.

 

I set up another fake test customer (set up as out of state to make sure they wouldn't get taxed) and used one of my myway.com email addresses. Got the Welcome Email and Order Process/Confirmation email just fine.

 

There are no emails in the AOL spam folder either.

 

What do I need to do so that any of my AOL customers will get any emails from me! *grins*

 

You could ask your host to get their servers 'Whitelisted' by AOL.

Link to comment
Share on other sites

My host is Netfirms. I contacted them about the email issue (since they supplied my cart), and after looking into it, they told me that their email server was recently blocked by AOL. :angry: They have requested that AOL release the block, but no telling if or when that will happen.

 

Just in case anyone else is using the same hosting service, that is why your emails are not going through to AOL addresses.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...