Jump to content

Contact form problems with gmail addresses


theillo
 Share

Recommended Posts

When I use my contact form and enter a gmail address, I receive an error message ( the error message from Line 197 from file \controllers\front\ContactController.php )

 

I hit the send button again, it shows a success message, and sends the "your message has been successfully sent" email. But I don't receive email notification that I have a new inquire on the admin email.

 

No problems with gmx addresses. 

 

So again:

Putting Gmail addresses in contact form:

  • takes 2 tries to send
  • does not send a notification to the admin

 

I assume what messes it up is "spoofing" I've had that before where I tried to set the "from" email address to a gmail address and that caused it to fail. So it could be relatively specific to my server. But I'd assume others have this problem, too. 

 

I wish I had the time and energy right now to analyze this cluster f**k of code that triggers the error, but I don't. No offense... Isn't there supposed to be a rule "if a function has more then 3 arguments, pass the arguments as an object or an associative array"? I'm no code pro, but I'm just sayin'... I KNOW you're not supposed to make a line longer than fits on the screen. This doesn't fit on my 22" monitor. Anyways...

 

Here is how the error gets triggered:

\controllers\front\ContactController.php line 197

					if (empty($contact->email))
						Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, null, null, $file_attachment);
					else
					{
						if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]',
							$var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),
									$file_attachment) ||
								!Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, $contact->email, $contact->name, $file_attachment))
									$this->errors[] = Tools::displayError('An error occurred while sending the message.  Please try resending.');
					}

I added the part where it says "please try resending"

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More