Guest User

Untitled

a guest
Nov 3rd, 2018
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <?php
  2. echo "start mail";
  3. echo "<br>";
  4. ini_set('memory_limit', '500M');
  5. ini_set('max_execution_time', 0);
  6. error_reporting(E_ALL | E_STRICT);
  7. ini_set('display_errors', 1);
  8. require_once 'app/Mage.php';
  9. umask(0);
  10. Mage::app();
  11. try {
  12. $post['name'] = 'vaibhav';
  13. $post['email'] = 'vaibhavahalpara@gmail.com';
  14. $post['telephone'] = '123456789';
  15. $postObject = new Varien_Object();
  16. $postObject->setData($post);
  17. $mailTemplate = Mage::getModel('core/email_template');
  18. $mailTemplate = Mage::getModel('core/email_template');
  19. $mailTemplate->setDesignConfig(array('area' => 'frontend'))
  20. ->setReplyTo('vaibhavahalpara@gmail.com')
  21. ->sendTransactional(
  22. Mage::getStoreConfig('contacts/email/email_template'),
  23. Mage::getStoreConfig('contacts/email/sender_email_identity'),
  24. 'vaibhavahalpara@gmail.com',
  25. null,
  26. array('data' => $postObject)
  27. );
  28. if (!$mailTemplate->getSentSuccess()) {
  29. throw new Exception();
  30. }
  31. echo "sent";
  32. } catch (Exception $e) {
  33. echo "string11465";
  34. echo $e->getMessage();
  35. }
  36.  
  37. $msg = "First line of textnSecond line of text";
  38. $msg = wordwrap($msg,70);
  39. mail("vaibhavahalpara@gmail.com","My subject",$msg);
  40.  
  41. $result = mail(
  42. $this->recipients,
  43. $this->_mail->getSubject(),
  44. $this->body,
  45. $this->header
  46. );
  47. echo $result;
Add Comment
Please, Sign In to add comment