Magento: Email To A Friend Doesn’t Work – Quick Fix
- Category: questions, web development
If you’re running Magento 1.4 (or 1.4.0.1) and your “email to a friend” form doesn’t send emails, that’s because your Magento template (Magento theme) is not fully compatible with 1.4.
Note that the “email to a friend” form won’t return any error – it just won’t send the email and won’t redirect to the product page like it’s supposed to.
So here’s what you’ll need to do to update your Magento template in order to quickly fix this error:
Open this file:
app/design/frontend/default/themename/template/sendfriend/send.phtml
Find this line:
<form action="<?php echo $this->getUrl('*/*/sendmail', array('id'=>$this->getProductId(), 'cat_id'=>$this->getCategoryId())) ?>" method="post" id="product_sendtofriend_form">
And add the following code below:
<?php echo $this->getBlockHtml('formkey')?>
That’s it!
Related posts:
- Magento contact form doesn’t work – quick fix
- Magento 1.4 – how to include toolbar and pagination when listing products
Don’t forget – subscribe and follow!
Be sure to subscribe to the feed and follow us on Twitter for more tips, resources, and giveaways!
Thanks,
Jack
I am new to magento and wanted to know something. After i hit submit for sending mail to friend i want to redirect it back to the products page. In which file i need to do changes.
Thanks in advance
Noam - October 19th, 2010
app/design/frontend/default/yourthemename/template/sendfriend/send.phtml
I tried this fix but my “email to friend” still doesn’t work. i am using magento 1.4.1.1. It shows “The link to a friend was sent” message but the email is not sent.
@bhab – try adding a new template for ‘Email to a friend’ under Admin > System > Transactional Emails > Add New Template. Use ‘Load Template’. And don’t forget to go to Admin > System > Configuration > Email to a friend > Select Email Template to select it. Your problem may have to do with a pre-1.4.x theme used with magento 1.4.1.1, thus the templates not compatible? Hope this helps.
Happy Magento’ing
Edwin
Jabez Networks, Inc.
Magento E-commerce, SEO, China Marketing.
After reading through the posts above of which I have tried I still cannot send any thing to a friend.
All i seem to get is
” The messages cannot be sent more than 10 times in an hour ”
I have changed the config and made a new email template and changed the code but still nothing.
I a am a newbie to magento and web design does anyone have any ideas where i go from here.
Thanks