Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Replying to emails sent from the Contact Us form.


shelby72

Recommended Posts

I just recently moved over from Godaddy to Interserver and I think something is wrong in my email settings somewhere but I'm not sure where to look.  When someone sends me an email from the Contact Us form, I get the email just fine, but when I reply back to them the email is sent back to me in my email account instead of going to the customer. I'm using Oscommerce 2.3.3.  Can someone please tell me how to fix this problem.

Link to comment
Share on other sites

The customer's email address does appear to be included in the email headers. Do you see their address in either the "from" or the "reply to" fields? I don't see "reply to" being explicitly set (defaulting to "from").

 

It may be that Interserver is more secure than GoDaddy, and is not allowing "forged" from email addresses (which is what an email coming from your site would appear to have, as it doesn't match your account). What you may end up having to do is write out the customer email address in the body of the email (in contact_us.php), and manually transfer it (copy and paste) to a reply. The code could be changed to include a different "reply to" field in the headers, but it would not be trivial, and I can't promise that your email system wouldn't trash it too.

Link to comment
Share on other sites

The customer's email address does appear to be included in the email headers. Do you see their address in either the "from" or the "reply to" fields? I don't see "reply to" being explicitly set (defaulting to "from").

 

It may be that Interserver is more secure than GoDaddy, and is not allowing "forged" from email addresses (which is what an email coming from your site would appear to have, as it doesn't match your account). What you may end up having to do is write out the customer email address in the body of the email (in contact_us.php), and manually transfer it (copy and paste) to a reply. The code could be changed to include a different "reply to" field in the headers, but it would not be trivial, and I can't promise that your email system wouldn't trash it too.

Link to comment
Share on other sites

The customer's email address does appear to be included in the email headers. Do you see their address in either the "from" or the "reply to" fields? I don't see "reply to" being explicitly set (defaulting to "from").

 

It may be that Interserver is more secure than GoDaddy, and is not allowing "forged" from email addresses (which is what an email coming from your site would appear to have, as it doesn't match your account). What you may end up having to do is write out the customer email address in the body of the email (in contact_us.php), and manually transfer it (copy and paste) to a reply. The code could be changed to include a different "reply to" field in the headers, but it would not be trivial, and I can't promise that your email system wouldn't trash it too.

when someone sends me an email through the contact us to [email protected] and I go to reply back to them I can see their email address in the "to" field but if I run my mouse over their email address it shows: their email address <[email protected]>. That of course sends the email back to me.

Link to comment
Share on other sites

Here is a solution:

general.php

  function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $reply_to = null) {
    if (SEND_EMAILS != 'true') return false;

    // Instantiate a new mail object
    $h[] = 'X-Mailer: osCommerce Mailer';
    if (tep_not_null($reply_to)) {
      $h[] = 'Reply-To: ' . $reply_to;
      //$from_email_address = $to_email_address;  //prevent delivery
    }
    $message = new email($h);

    // Build the text version
    $text = strip_tags($email_text);
    if (EMAIL_USE_HTML == 'true') {
      $message->add_html($email_text, $text);
    } else {
      $message->add_text($text);
    }

    // Send message
    $message->build_message();
    $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
  }

mail.php

      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 ".STORE_OWNER_EMAIL_ADDRESS);
      }


But I use 2 different admin email address in one email to prevent spam filters.

 

tep_mail(STORE_OWNER, '[email protected]', $emailsubject, $enquiry, $name, STORE_OWNER_EMAIL_ADDRESS, $email_address);

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I can see their email address in the "to" field but if I run my mouse over their email address it shows: their email address <[email protected]>. That of course sends the email back to me.

It (either osC or your email system) is using the customer email address as the customer name (before the <>), and then using your email address (within <>) as the actual email address. Is your osC modified in any way in the contact us area? Just reading the incoming email (in your email client), does it show that same mixed-up address?

Link to comment
Share on other sites

 

Here is a solution:

 

general.php

  function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $reply_to = null) {
    if (SEND_EMAILS != 'true') return false;

    // Instantiate a new mail object
    $h[] = 'X-Mailer: osCommerce Mailer';
    if (tep_not_null($reply_to)) {
      $h[] = 'Reply-To: ' . $reply_to;
      //$from_email_address = $to_email_address;  //prevent delivery
    }
    $message = new email($h);

    // Build the text version
    $text = strip_tags($email_text);
    if (EMAIL_USE_HTML == 'true') {
      $message->add_html($email_text, $text);
    } else {
      $message->add_text($text);
    }

    // Send message
    $message->build_message();
    $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
  }

mail.php

      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 ".STORE_OWNER_EMAIL_ADDRESS);
      }

But I use 2 different admin email address in one email to prevent spam filters.

 

 

tep_mail(STORE_OWNER, '[email protected]', $emailsubject, $enquiry, $name, STORE_OWNER_EMAIL_ADDRESS, $email_address);

@@Gergely do you know if this is being added to the core?   I sent out a bulk type mailing from my BS shop yesterday and my ISP complained about getting a ton of emails being rejected by other ISPs.   On inspection it looks like it was because of the missing "Reply-To:" header.  As you no doubt know, in those circumstances many ISPs will reject the email and return them to your host....my host seems to dump them in one of their own email baskets so they can address any spamming issues.   I bet there is a ton of shop emails that get sent and simply don't reach the intended recipient due to this. 

 

We exchanged notes in the following thread a little over a year ago and while I fixed it on my old site, I forgot about it when I updated to BS and it kicked me in the butt again.

 

http://www.oscommerce.com/forums/topic/397929-email-return-path/

 

Dan

Link to comment
Share on other sites

 

Here is a solution:

 

general.php

  function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $reply_to = null) {
    if (SEND_EMAILS != 'true') return false;

    // Instantiate a new mail object
    $h[] = 'X-Mailer: osCommerce Mailer';
    if (tep_not_null($reply_to)) {
      $h[] = 'Reply-To: ' . $reply_to;
      //$from_email_address = $to_email_address;  //prevent delivery
    }
    $message = new email($h);

    // Build the text version
    $text = strip_tags($email_text);
    if (EMAIL_USE_HTML == 'true') {
      $message->add_html($email_text, $text);
    } else {
      $message->add_text($text);
    }

    // Send message
    $message->build_message();
    $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
  }

mail.php

      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 ".STORE_OWNER_EMAIL_ADDRESS);
      }

But I use 2 different admin email address in one email to prevent spam filters.

 

 

tep_mail(STORE_OWNER, '[email protected]', $emailsubject, $enquiry, $name, STORE_OWNER_EMAIL_ADDRESS, $email_address);

I tried this solution.  I have 2 websites. This solution works fine for one of them but not the other. The only difference in the files is that the site it's not working for I do have the Contact Us Enhancement contribution on. 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...