Emails not being sent from Virtuemart 2

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Emails not being sent from Virtuemart 2

Postby admin » Wed Feb 20, 2013 7:30 pm

Hello friends,
we recently came around an issue caused by a specific configuration of your hosting and the way virtuemart sends emails. The issue was casued when using php mail function which usually uses the system's sendmail function that requires some parameters such as "-oi -f info@domain.com". For this reason we advised a patch for Virtuemart 2.0.x (after 18a) into your

\components\com_virtuemart\helpers\shopfunctionsf.php

Code: Select all
// set proper sender
  $sender = array();
  if (!empty($view->vendorEmail))
  {
   $sender[0] = $view->vendorEmail;
   $sender[1] = $view->vendor->vendor_name;
  }
  else
  {
      // use default joomla's mail sender
   $app = JFactory::getApplication();
   $sender[0] = $app->getCfg('mailfrom');
   $sender[1] = $app->getCfg('fromname');
  }
  $mailer->setSender($sender);


insert right before
Code: Select all
return $mailer->Send();


in your

private static function sendVmMail (&$view, $recipient, $noVendorMail=FALSE) {


Many other customers of ours had a similar issue - the vendor email was improperly configured. if you are having issues with your mail function, it is strongly recommended that you check within your phpMyAdmin:

#__virtuemart_vmusers has at least one user set as is_vendor=1 and vendor_id=1 (remember it's virtuemart_user_id ID - usually 42 for joomla 2.5 and 62 for joomla 1.5 admin user)
and your
#__users check if the user with the above ID (usually 42 or 62 for admin) has a proper and valid email configured


If all of the above is well configured and you apply the above patch and you are still having issues with your email, we recommend to check
- your hosting may not allow to send emails in the name of a domain which is not hosted on your server - so you can't send emails as @gmail.com when you are using @domain.com (relay not allowed)
- the emails are delivered to SPAM when no proper sender is configured and the foregin server did not validate your server as an eligible sender. For this reason you can ask your hosting (or try to do it in your cpanel) to configure TXT DNS (some support SPF DNS) records to contan something like this:
Code: Select all
v=spf1 a mx ip4:92.240.237.141 ip4:92.240.237.142 include:rupostel.sk include:_spf.google.com ?all;


which says:
eligible senders are
- with IPs 92.240.237.141, 92.240.237.142 (our rupostel.com servers - change these to yours)
- include remote SPF configuration from rupostel.sk (which has these txt records as well)
- include google's spf records, so you can send your emails from gmail.com as @yourdomain.com and they are not delivered to spam
- ?all; (treat others as "don't know" ) -> can be changed to strictly set that no other senders are permitted

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Return to One Page Checkout for Virtuemart 2