Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Send email form with submit on
 
mtaskov
Jr. Member
 
Total Posts:  17
Joined:  2013-02-07
 

I want to send a email form on submit button something like the contact form here is example of the code

<div class="div1">
<form method="post" name="myForm" action="mailto:anybody@example.com>
<ul class="div2">
<li>
<label><span class="div3">FirstName </span><span style="color:#DF0101;"> *</span></label>
<div class="div1">
<input type="text" name="FirstName" style="width:400px;"/>
</div>
</li>
<li>
<label ><span class="div3">Last Name </span><span style="color:#DF0101;"> *</span></label>
<div class="div1">
<input type="text" name="LaatName" style="width:400px;"/>
</div>
</li>
<li>
<input type="submit" value="Submit" />
</li>
</ul>
</form>
</div>

but in this case when i click submit the mail is not parsed i want to send mail with php code how can i do that and
the form is showing in cms page any help please

 
Magento Community Magento Community
Magento Community
Magento Community
 
paravicini
Member
 
Total Posts:  38
Joined:  2013-03-27
 

In the cms page, add the folowing code:

{{block type=\"catalog/product_list\" template=\"contact/contact.php\"}}

In the directory:
app\\design\\frontend\\default\\[your_theme]\\template
create a new folder \’contact\’. Place in that new folder the contact.php file.

The code is too long to place with this answer. See the text file for the php code (the text file can be stored as php file).

I used this php code to send emais some time ago. Please modify the code below the comment:
//MODIFY THIS.

I hope this helps.

Edit:
I see there are slashes (\) added before the double quotes. To let the code above work, remove the slashes: \.

File Attachments
contact.txt  (File Size: 9KB - Downloads: 34)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Indies Inc
Sr. Member
 
Avatar
Total Posts:  193
Joined:  2013-09-18
 

Hi,
For sending the mail on the click event, there are two ways that I am using randomly. You can choose one as per your need.

1.  Using the Magento standard template way.
2.  Using the Ajax Request and write code for sending mail.

Choice of option depends upon particular requirement.
Hope this will help you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ahmadneyaj786
Jr. Member
 
Total Posts:  1
Joined:  2013-11-19
 

Hi paravicini,

Your contact.txt is not downloadable. Please make it downlaodable,
Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
paravicini
Member
 
Total Posts:  38
Joined:  2013-03-27
 

@ahmadneyaj786

Can\’t find the same file anymore for this post that is almost one year old.

And to be honest, the code was not pretty at all.

But there is a better way for the same result: an email form with submit button.
This uses the default email template of Magento.

Add the code below in: CMS -> Pages -> Yourpage

{{block type=\"core/template\" name=\"contactForm\" form_action=\"/contacts/index/post\" template=\"contacts/form.phtml\"}}

Hope this helps anyone.

Greetings,
Paravicini

Edit:
I see there are slashes (\) added before the double quotes. To let the code above work, remove the slashes: \.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top