Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

How to insert link in EmailTemplate's body? Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

How to insert link in EmailTemplate's body?

Unread post 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?
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

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

Unread post by kev1n »

miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

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

Unread post 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
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

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

Unread post 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
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

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

Unread post 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. :)
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

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

Unread post 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
));
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

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

Unread post 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
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

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

Unread post 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
));
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

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

Unread post by miasoft »

Thx, kevln! All works fine! :)
Wbr, miasoft.
Post Reply