1

Hello My magento site have suddenly mailing process not working. Please help me I have SMTP. It's working fine but now mails are not working. Please shortout my problem.

1 Answer 1

0

Please check your mail is working or not for this you need to place this script in the root of your site:

<?php

// Send mail, the Magento way:
require_once('app/Mage.php');
Mage::app();

// Create a simple contact form mail:
$emailTemplate = Mage::getModel('core/email_template')
    ->loadDefault('contacts_email_email_template');
$data = new Varien_Object();
$data->setData(    
    array(
        'name' => 'Your name',
        'email' => '[email protected]',
        'telephone' => '7856512345',
        'comment' => 'This is a test'
    )
);
$vars = array('data' => $data);

// Set sender information:
$storeId = Mage::app()->getStore()->getId();
$emailTemplate->setSenderEmail(
    Mage::getStoreConfig('trans_email/ident_general/email', $storeId));
$emailTemplate->setSenderName(
    Mage::getStoreConfig('trans_email/ident_general/name', $storeId));
$emailTemplate->setTemplateSubject('Test mail');
$email = 'yourmail.com';
// Send the mail:
$output = $emailTemplate->send($email, null, $vars);
var_dump($output);
?>

Change $email = 'yourmail.com'; to your correct email id and save it in a file called emailtest.php, and simply call it in the browser like this http://www.yourdomain.com/emailtest.php

Now you should see a true -message when Magento was able to send the mail and false if not. If this work check your cron setting for more on cron see here.

3
  • Hi, I have got bool(false). I think not working. Commented Dec 28, 2016 at 6:57
  • @ChirayuVyas there might be server issue check all seting or contact to your sever support team hope they will resolve the issue.good luck
    – Arunendra
    Commented Dec 28, 2016 at 7:02
  • @Aruendra I have VPS server. Commented Dec 28, 2016 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.