1

I had created the form with some fields and when I click on the submit button it should send the email.So,I had created the phtml file sending mails but i am not getting any mails by clicking on the button.

Under CMS page I had created the new page to redirect the page.

Please help me.

Annaram Ravinder
  • 137
  • 1
  • 10

3 Answers3

0

You can send email using "Edit Email Template". Click here for more detail.

Hardik Visa
  • 769
  • 1
  • 9
  • 36
0

I tested your sendmail.phtml code on my dev server and can confirm that it does send an email, so the problem must lie somewhere with your server mail system.

Do other emails work correctly?

To test email from the command line you can do

echo "This is a test." | mail -s Testing your@email.address
7ochem
  • 7,532
  • 14
  • 51
  • 80
paj
  • 5,785
  • 5
  • 21
  • 43
0
<?php
public function sendMailAction(){
$html="
put your html content here
blah blah

";
$mail = Mage::getModel('core/email');
$mail->setToName('Your Name');
$mail->setToEmail('Youe Email');
$mail->setBody('Mail Text / Mail Content');
$mail->setSubject('Mail Subject');
$mail->setFromEmail('Sender Mail Id');
$mail->setFromName("Msg to Show on Subject");
$mail->setType('html');// YOu can use Html or text as Mail format

try {
$mail->send();
Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
$this->_redirect('');
}
catch (Exception $e) {
Mage::getSingleton('core/session')->addError('Unable to send.');
$this->_redirect('');
}
}
?>
Annaram Ravinder
  • 137
  • 1
  • 10