Jump to content

GoDaddy and contact emails problem


Recommended Posts

when a user fills the Contact form, prestashop will try to send an email like this:

From: [email protected]
To: [email protected]
...



Now GoDaddy will not send this email because user_domain (gmail) is different from your_shop_domain.

I used this test script testemail.php:

<?
if( mail('[email protected]','test email','test email', null,'[email protected]') ) {
   echo 'sent ';
} else {
   echo 'not sent ';
}

if( mail('[email protected]','test email','test email', null,'-fme@my_shop_domain.com') ) {
   echo 'sent ';
} else {
   echo 'not sent ';
}
?> 


'[email protected]' will set the From: field of the email.

In BO / preferences / email I have: use mail() and plain text selected. SMTP has the same problems so this is not important.

The script will display "sent sent" but actually only the second email arrives. The first one will be blocked by GoDaddy.

My question is how to configure or modify presta so that it will send emails like this:

From: me@my_shop_domain.com
To: [email protected]

You have an message from [email protected]
...



or event better:

From: me@my_shop_domain.com
To: [email protected]
Reply-to: [email protected]

You have an message from [email protected]
...

Link to comment
Share on other sites

Hi! thanks for reply. It didn't work. The from field was set but email was still not sent and the $params = ""; I don't know what it did but when I submit the form there is no message displayed on the next page...

What I did and it worked for me was to modify contact-form.php from this:

if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $_POST['from'], '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from)))


to this (notice the two null which stand for $from and $fromname):

if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, NULL, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : NULL)))


This works because when the $from and $fromname are not set, in mail.php they will be set to the data configured in back-office:

if (!isset($from)) $from = $configuration['PS_SHOP_EMAIL'];
if (!isset($fromName)) $fromName = $configuration['PS_SHOP_NAME'];



Now I just have to figure out how to populate the reply-to...

Link to comment
Share on other sites

  • 1 month later...

Tomer,

Hi! I am grateful for your well explained instructions!

I have been using prestashop for over a year and I love it.

I had the initial godaddy/emails problems when I first started and someone helped me get it fixed, no idea exactly how.

I upgraded 2 days ago to the newest stable version (PS v.1.2.5)
Then the emails problem returned. I followed your instructions on your site and the emails are mostly working (contact form, all notifications to the customers).

The only email I wasn't receiving was the 'New Order' notification when an order processed.

I went into the Mail Alerts Module and set it to send notification for new orders and product out of stock, providing my [email protected] email address.

After that, the needed emails still are not coming and the new orders are not appearing in the "Orders" tab in the back office! I still receive the notification of payment from paypal and the customer receives verification of the order and payment.

The first 3 orders I processed before making the changes did register in the 'Orders' in back office, but the email messages didn't come through.

Now no orders register. Do you have any idea what my problem might be? :)

Thank you so much!

MaryRenee'

Link to comment
Share on other sites

Ok a couple of things are new now :)

I re-installed the Paypal Module and reconfigured it.

Now the following is happening:

New Order mail - received (for the first time yea!)
Order shows up in Back Office
Customer receives all notifications and messages.

Payment notification from Paypal is the only thing missing now.

Thank you!

MaryRenee'

Link to comment
Share on other sites

I'm still working on the Paypal email notification of payment, but noticed another problem upon further setup and testing.

When a customer chooses to pay by cheque, there is no order confirmation sent to the customer.

I receive the order in back office and the new order email.

Would you think this is related to godaddy at all or just a bug in the code for cheque payment?

Link to comment
Share on other sites

Also not getting a new order notification when customer pays by Google Checkout.

I receive the Google Checkout confirmation at my separate gmail address. The customer receives both the prestashop order email and the google checkout payment confirmation.

The order shows in the back office.

My host mail doesn't receive anything.

Thanks to anyone who can help me!

MaryRenee'

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 4 weeks later...
what worked for me is in post #2

hi,ioane
I did as you said but there are nothing different.
I used php mail() and when i send email in contact-form,it displayed "Your message has been successfully sent to our team." but the real is: i don't received any message.
____________________________________________
ps1.2.5
godaddy linux php5
and the php.ini
register_globals = off
allow_url_fopen = off

expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

[Zend]
zend_extension=/usr/local/zo/ZendExtensionManager.so
zend_extension=/usr/local/zo/4_3/ZendOptimizer.so



i was looking for the solution about a week.And i don't know what i can do now.
i don't wan't to replace the godaddy.
can you help me? waiting for your reply
thanks a lot!

Link to comment
Share on other sites

you also have to configure Presta 1.2.5.

1 Preferences/Contact/Shop e-mail: you@your-shop-domain.com. It's very important to put an email on the same domain as the shop. It will not work with emails on yahoo.com or gmail.com

2 Preferences/Email/: use php mail() and Send mail as text. You can change this to Both after you see that it is working.

3 Modules/Mail alerts: check Product availability,New order,Out of stock and put some email in Send to this emails (any email, even yahoo, gmail etc.)

4 Employees/Contacts: put some emails (any domain) for Webmaster, Customer Service

#3 it's not needed for contact form but you will need it anyway.

I hope it will work, it's been a long time since I did this. If it doesn't, we can talk in private.

Link to comment
Share on other sites

  • 1 year later...

Thanks ioane for the solution. The problem happened to my godaddy hosting too.

 

I guess for version 1.4.6.2 - line 156 - controller/ContactController.php

 

From

if (Mail::Send((int)self::$cookie->id_lang, 'contact', Mail::l('Message from contact form', (int)self::$cookie->id_lang), array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment)

 

To

if (Mail::Send((int)self::$cookie->id_lang, 'contact', Mail::l('Message from contact form', (int)self::$cookie->id_lang), array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, NULL,  ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : NULL), $fileAttachment)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...