Page 1 of 1

How to insert link in EmailTemplate's body?

Posted: Sat Nov 26, 2022 7:36 am
by miasoft
I'm try use EmailTemplate. If I insert link in body, for example:

Code: Select all

<a href="http://xx.yy.jj.kk:zzzz/ozmain/index.php?u=hidden&p=hidden&f=6379xxxx&r=#IDLK#
">ЛК</a>
or simple string

Code: Select all

https://www.yandex.ru
I get error message:

Code: Select all

Message sending failed
SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Message rejected under suspicion of SPAM; https://ya.cc/1IrBc 1669439863-gHFwZi6V54Y1-1fVCGx1H SMTP code: 554 Additional SMTP info: 5.7.1
email sends OK without embedded link. What is a wrong?

Re: How to insert link in EmailTemplate's body?

Posted: Sat Nov 26, 2022 7:43 am
by kev1n

Re: How to insert link in EmailTemplate's body?

Posted: Sat Nov 26, 2022 8:15 am
by miasoft
kev1n wrote: Sat Nov 26, 2022 7:43 am A yandex issue?
No. I have send the message from another my program (I use LibCurl as sender) - no problem.
I manual create and send message with link - no problem

Re: How to insert link in EmailTemplate's body?

Posted: Sat Nov 26, 2022 10:30 am
by kev1n
Anyway, the message is blocked by Yandex. You must either find out why or contact their support to find a solution.

This might also be helpful: https://spark.ru/startup/pushall/blog/1 ... ast-v-spam

Re: How to insert link in EmailTemplate's body?

Posted: Sat Nov 26, 2022 4:09 pm
by miasoft
kev1n wrote: Sat Nov 26, 2022 10:30 am Anyway, the message is blocked by Yandex. You must either find out why
Now I use another PHP-mailer procedure. I set additional parameters:

Code: Select all

$mail->SMTPOptions = array (
    'ssl' => array (
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);

and my Body now:

Code: Select all

$mail->Body= (' ФИО : '.'#FIO#'.". "."<br>\n".
             '  Город : '.'#CITY#'.". "."<br>\n".
             '  Регион : '.'#REGION#'.". "."<br>\n".
             '  Место : '."#MESTOPRAK1#".". "."<br>\n".
             '  Начало : '.'#DCHANGE#'.". "."<br>\n".
             
 '<a href="http://xx.yy.zz.jj:nnnn/ozmain/index.php?u=hidden&p=hidden&f=123456789&r='.'#IDLK#'.'">Ссылка на личный кабинет</a>');
All works Ok. :)

Re: How to insert link in EmailTemplate's body?

Posted: Sun Nov 27, 2022 11:56 am
by kev1n
I updated nuSendEmail() so you can pass SMTP options to the function (Modified nuemailer.php and nucommon.php)
Could you test if it works for you?

Code: Select all

$smtpOptions = 
array (
    'ssl' => array (
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);


$sendResult = nuSendEmail(array(
	'to' => 'to_address@something.com',
	'body' => 'test body',
	'subject' => 'test subject',
	'smtp_options' => $smtpOptions
));

Re: How to insert link in EmailTemplate's body?

Posted: Mon Nov 28, 2022 7:30 am
by miasoft
kev1n wrote: Sun Nov 27, 2022 11:56 am I updated nuSendEmail() so you can pass SMTP options to the function (Modified nuemailer.php and nucommon.php)
Could you test if it works for you?
I tested modifications. Now I have not errors from mail-server.
But I can't insert link like <a href=".....">my page</a> - message not passed to mailbox

Re: How to insert link in EmailTemplate's body?

Posted: Mon Nov 28, 2022 8:02 am
by kev1n
I do see the link when using this code:

Code: Select all

$smtpOptions = 
array (
    'ssl' => array (
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);

$link = '<a href="https://www.nubuilder.com/">nuBuilder</a>';

$sendResult = nuSendEmail(array(
	'to' => 'myemail@something.com',
	'body' => 'test<hr> <b>test html</b> '.$link,
	'subject' => 'test subject',
	'smtp_options' => $smtpOptions
));

Re: How to insert link in EmailTemplate's body?

Posted: Mon Nov 28, 2022 8:49 am
by miasoft
Thx, kevln! All works fine! :)