Page 1 of 2

hb_SendMail vs GMAIL

Posted: Tue Sep 20, 2022 1:24 pm
by Roberto Lopez
Hi All,

I send automatic notification mails from an HMG ap using hb_sendmail

Since last weeks, GMAIL recipients messages are returned with the following error:
"Mail delivery failed: returning message to sender"... "A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:"... blah blah blah...
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [...] Messages missing a valid messageId header are not
550 5.7.1 accepted. ... - gsmtp
It appears to be some anti-spam control or something like that...

Any idea/workaround?

Any help is welcome.

TIA.

Re: hb_SendMail vs GMAIL

Posted: Tue Sep 20, 2022 3:57 pm
by serge_girard
I use command line for Thunderbird (few emails) but if the message is the same for all one can use bcc!
Something like this:

c:\Progra~2\Mozill~1\thunderbird -compose "bcc='someone@somesite.xx;someone@somesite.xx;someone@somesite.xx;someone@somesite.xx;someone@somesite.xx;someone@somesite.xx;',subject='Some subject',format='html',body='bla',message='C:\GS\UITN.HTML'"

One click only!

Serge

Re: hb_SendMail vs GMAIL

Posted: Wed Sep 21, 2022 2:35 pm
by franco
I still use gmail.
Google has modified so you do not have turn security down.
You must turn on 2 step verification then register the program you are using with google.
This is done inside the gmail account. It will then have 2 passwords. your original
for working with gmail account outside the program and a special password for the progam for sending mail.
Here is an example of what is in the help file for my clients.
Open gmail account
Go settings.... a little star at the right.
Go to all Settings.
Go to Account and Import.
Go to Other Google Account Settings.
Goto security.
Go to 2 step verification and turn this on.
You will have to go back a step then back to security again.
Then go to app passwords and add APP C:\YOURFOLDER\YOURAPP.EXE
You will get a code by email or on text from Google.
It come in yellow.
Copy this code. This is the new YOURAPP password. Use this in yourapp.
You keep the old password for using account outside yourapp.
Works fine.
Franco

Re: hb_SendMail vs GMAIL

Posted: Wed Sep 21, 2022 9:10 pm
by jparada
Roberto Lopez wrote: Tue Sep 20, 2022 1:24 pm Hi All,

I send automatic notification mails from an HMG ap using hb_sendmail

Since last weeks, GMAIL recipients messages are returned with the following error:
"Mail delivery failed: returning message to sender"... "A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:"... blah blah blah...
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [...] Messages missing a valid messageId header are not
550 5.7.1 accepted. ... - gsmtp
It appears to be some anti-spam control or something like that...

Any idea/workaround?

Any help is welcome.

TIA.
https://hmgforum.com/viewtopic.php?f=5& ... sos#p68766

Re: hb_SendMail vs GMAIL

Posted: Thu Sep 22, 2022 3:01 am
by AUGE_OHR
hi,

as i understood you can send Email "from" Gmail but when send Email "to" Gmail it will be reject by Gmail, right ?

i "think" it is the same Problem with WEB.DE or GMX which you have with Gmail when use hb_SendMail.
as i can say those Email do not include "Message-ID" in Email Header when send "direct" to Provider (does work when send to Exchange Server)

"Message-ID" seems to be a UUID@Domain.DE but i do not know how to place it into tip_MailAssemble()

---

there is a hb_CURL Email Sample which seems to use "Message-ID"
https://www.hmgforum.com/viewtopic.php?t=7289

but i´m not able to build a LIB.A from Source for HMG so i can not "test" it

Re: hb_SendMail vs GMAIL

Posted: Sun Sep 25, 2022 12:19 am
by danielmaximiliano
AUGE_OHR wrote: Thu Sep 22, 2022 3:01 am

"Message-ID" seems to be a UUID@Domain.DE but i do not know how to place it into tip_MailAssemble()

---

there is a hb_CURL Email Sample which seems to use "Message-ID"
https://www.hmgforum.com/viewtopic.php?t=7289

but i´m not able to build a LIB.A from Source for HMG so i can not "test" it
Hola Jimmy, puede ud enviarme el ejemplo y en negrita #bold# la parte que quiere agregar enTip_mailassemble() yo hace mucho lei todo sobre esa libreria contrib

Re: hb_SendMail vs GMAIL

Posted: Sun Sep 25, 2022 7:16 am
by serge_girard
In case my email has a fixed message with few variables, I also use a PHP program that
is called as follows:

Code: Select all

cURL	:= 'https://www.yoursite.com' 
cURL	:= STRTRAN(cURL,'www.','')
cURL	:= cURL + '/mailsend.php?c1=' + ALLTRIM(xC1) + '&c2=' + ALLTRIM(xC2)  
EXECUTE FILE cURL
With c1 and c2, the PHP program will know what it is about and compose the message,
in brief:

PHP-HTML Code

Code: Select all

$S2 = 'NOK';
// check c1 and c2 in database
if ( check OK ):   // OK

	$html     = '<html>';
	$html    .= '<head>';
	$html    .= '<style type="text/css"></style>';
	$html    .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">';
	$html    .= '<title></title>';
	$html    .= '</head>';
	$html    .= '<body>';
	$html    .= "Dear....<br><br>";
	$html    .= "bla bla ';   
	$html    .= '</body>';
	$html    .= '</html>';

	$from_name  = 'your name';
	$from_mail  = 'youremail@address.com';
	$cc         = $from_mail;
	$replyto    = $from_mail;
	$mailto     = 'towho@address.com';    
	$subject    = 'Important message ' . "\r\n";              

	$uid        = md5(uniqid(time()));

	$header      = "From: ". $from_name. " <". $from_mail. ">\r\n";
	$header     .= "Cc: "   . $cc   . "\r\n";
	$header     .= "Reply-To: ". $replyto ."\r\n";
	$header     .= "MIME-Version: 1.0\r\n";
	$header     .= "Content-Type: multipart/mixed; boundary=\"". $uid. "\"\r\n\r\n";

	$nmessage    = "--". $uid. "\r\n";
	$nmessage   .= "Disposition-Notification-To:GS <info@girard-software.com>" . "\r\n";
	$nmessage   .= "Content-type:text/html;charset=UTF-8" . "\r\n";
	$nmessage   .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
	$nmessage   .= $html. "\r\n\r\n";
	$nmessage   .= "--". $uid. "\r\n";


	if (mail($mailto, $subject, $nmessage, $header)) :  
	   $S2 = 'OK';
	endif;
endif;
?> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css"></style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
</head>
<body>
<?php echo $S2;?>
</body>
</html>

Of course in both PRG and PHP I use same MySQL database !

Serge

Re: hb_SendMail vs GMAIL

Posted: Sun Sep 25, 2022 8:54 pm
by AUGE_OHR
hi Daniel,
danielmaximiliano wrote: Sun Sep 25, 2022 12:19 am Hola Jimmy, puede ud enviarme el ejemplo y en negrita #bold# la parte que quiere agregar enTip_mailassemble() yo hace mucho lei todo sobre esa libreria contrib
thx for Offer.

i have compare my Tip_mailassemble() Version with Edwards Version and both are same
https://www.hmgforum.com/viewtopic.php?f=5&t=7289

so it is not a Problem of Tip_mailassemble( itself

Re: hb_SendMail vs GMAIL

Posted: Sun Sep 25, 2022 9:20 pm
by edk
It seems to me that the Message-Id section in the message header is added by the SMTP server (at least that's what the servers I tested on do), but if it doesn't, you can add it yourself in the tip_MailAssemble() function by putting for example: oMail:hHeaders ["Message-Id"] := "<slmwpywxvdcsjdcmzpph@btmg>" after the line: oMail:SetHeader (cSubject, cFrom, xTo, xCC)

Re: hb_SendMail vs GMAIL

Posted: Sat Oct 22, 2022 8:25 pm
by Roberto Lopez
Thanks to all for the answers...

For clarification, I'm not trying to send messages from a Gmail account, but to gmail accounts.

I'll keep researching and trying...

Thanks Again!