<div dir="ltr">Enable debug mode in phpmailer or the smtp mailer class. That should give you the error.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019 at 7:21 PM lucia digirolamo <<a href="mailto:l.digirolamo@websonica.net">l.digirolamo@websonica.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi<br>
<br>
on vtiger 6 I had a custom function (called by a workflow) that would <br>
send email via php with the Vtiger_Mailer class. My code was the following:<br>
<br>
     $mailer = new Vtiger_Mailer();<br>
     $mailer->IsSMTP(); // send via SMTP<br>
     $mailer->IsHTML(true);<br>
$mailer->ConfigSenderInfo($mailerfromemail,$mailerfromname,$mailerreplyto);<br>
     $mailer->AddReplyTo($mailerreplyto);<br>
     $mailer->Subject = $subject;<br>
     $mailer->Body = $message;<br>
     $mailer->AddAddress($to,$name);<br>
     $status = $mailer->Send(true);<br>
<br>
This code on vtiger 6 works. I'm now trying to do the same thing on <br>
vtiger 7.1 (so, I'm trying to send an email via php code on custom <br>
function workflow) but neither Vtiger_Mailer nor send_mail() are <br>
working. The outgoing server is working because email are being sent via <br>
normal workflow (workflow > actions > send mail); Sendmail is working as <br>
well because I can find it with "which sendmail" and the mail is <br>
correctly sent from cli. The only emails that fails are the ones from <br>
the php code of the custom function. What I have tried so far:<br>
<br>
- Vtiger_Mailer:<br>
<br>
     require_once 'vtlib/Vtiger/Mailer.php';<br>
     global $HELPDESK_SUPPORT_EMAIL_ID;<br>
     $subject = "some subject for this email";<br>
     $description = "some content from new crm";<br>
     $mailer = new Vtiger_Mailer();<br>
     $mailer->IsHTML(true);<br>
     $mailer->ConfigSenderInfo($HELPDESK_SUPPORT_EMAIL_ID);<br>
     $mailer->Subject =$subject;<br>
     $mailer->Body = $description;<br>
     $mailer->AddAddress($myemail);<br>
     $status = $mailer->Send(true);<br>
<br>
- sendmail:<br>
<br>
     require_once("modules/Emails/mail.php");<br>
     $module = "Potentials";<br>
     $to_email = $myemail;<br>
     $from_name = $myname;<br>
     $from_email = $fromemail;<br>
     $subject = "some subject for this email";<br>
     $contents = "some content from dieffe crm new";<br>
     $cc = "";<br>
     $bcc = "";<br>
     $attachment = "";<br>
send_mail($module,$to_email,$from_name,$from_email,$subject,$contents,$cc,$bcc,$attachment);<br>
<br>
Any clue on how to have this work?<br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>