hb_SendMail vs GMAIL

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

hb_SendMail vs GMAIL

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: hb_SendMail vs GMAIL

Post 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
There's nothing you can do that can't be done...
franco
Posts: 921
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: hb_SendMail vs GMAIL

Post 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
All The Best,
Franco
Canada
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

Re: hb_SendMail vs GMAIL

Post 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
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: hb_SendMail vs GMAIL

Post 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
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: hb_SendMail vs GMAIL

Post 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: hb_SendMail vs GMAIL

Post 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
There's nothing you can do that can't be done...
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: hb_SendMail vs GMAIL

Post 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
have fun
Jimmy
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: hb_SendMail vs GMAIL

Post 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)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: hb_SendMail vs GMAIL

Post 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!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply