[Vtigercrm-developers] vtiger 7.1 send email via custom function not working?
nilay khatri
nilay.spartan at gmail.com
Fri Jun 21 14:17:30 GMT 2019
Enable debug mode in phpmailer or the smtp mailer class. That should give
you the error.
On Fri, Jun 21, 2019 at 7:21 PM lucia digirolamo <l.digirolamo at websonica.net>
wrote:
> Hi
>
> on vtiger 6 I had a custom function (called by a workflow) that would
> send email via php with the Vtiger_Mailer class. My code was the following:
>
> $mailer = new Vtiger_Mailer();
> $mailer->IsSMTP(); // send via SMTP
> $mailer->IsHTML(true);
> $mailer->ConfigSenderInfo($mailerfromemail,$mailerfromname,$mailerreplyto);
> $mailer->AddReplyTo($mailerreplyto);
> $mailer->Subject = $subject;
> $mailer->Body = $message;
> $mailer->AddAddress($to,$name);
> $status = $mailer->Send(true);
>
> This code on vtiger 6 works. I'm now trying to do the same thing on
> vtiger 7.1 (so, I'm trying to send an email via php code on custom
> function workflow) but neither Vtiger_Mailer nor send_mail() are
> working. The outgoing server is working because email are being sent via
> normal workflow (workflow > actions > send mail); Sendmail is working as
> well because I can find it with "which sendmail" and the mail is
> correctly sent from cli. The only emails that fails are the ones from
> the php code of the custom function. What I have tried so far:
>
> - Vtiger_Mailer:
>
> require_once 'vtlib/Vtiger/Mailer.php';
> global $HELPDESK_SUPPORT_EMAIL_ID;
> $subject = "some subject for this email";
> $description = "some content from new crm";
> $mailer = new Vtiger_Mailer();
> $mailer->IsHTML(true);
> $mailer->ConfigSenderInfo($HELPDESK_SUPPORT_EMAIL_ID);
> $mailer->Subject =$subject;
> $mailer->Body = $description;
> $mailer->AddAddress($myemail);
> $status = $mailer->Send(true);
>
> - sendmail:
>
> require_once("modules/Emails/mail.php");
> $module = "Potentials";
> $to_email = $myemail;
> $from_name = $myname;
> $from_email = $fromemail;
> $subject = "some subject for this email";
> $contents = "some content from dieffe crm new";
> $cc = "";
> $bcc = "";
> $attachment = "";
>
> send_mail($module,$to_email,$from_name,$from_email,$subject,$contents,$cc,$bcc,$attachment);
>
> Any clue on how to have this work?
>
>
>
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20190621/50827393/attachment.html>
More information about the vtigercrm-developers
mailing list