Jump to content
TNG Community

Synology server for TNG, send mail won’t work


Mark Woods

Recommended Posts

I have set up my TNG website on a Synology web server. So far everything seems to be working fine except sending an email from TNG. Are there any Synology users out there that can give me advice. I tried with just my email entered in the admin settings page, then I tried using my gmail account information, SMPT server and port number with no luck.

Any suggestions?

 

thanks

Mark

Link to comment
Share on other sites

I just use a standard outlook account through smtp.

In the Setup page I set the Mail and registration settings as below.

Use SMTP authentication = yes

SMTP host name = smtp-mail.outlook.com

Mail Username = (outlook email address)

Mail Password = (outlook account password)

Port number = 587

Encryption = starttls

Link to comment
Share on other sites

I use gmail without any hassles on a QNAP NAS.

 

Use SMTP authentication = yes

SMTP host name = smtp.gmail.com

Mail Username = (full gmail email address)

Mail Password = (gmail account password)

Port number = 465

Encryption = ssl

 

The only tricky thing is if you use two factor authentication , you need to get an app password instead of just your usual gmail account password

See this page for more details On all of this;  https://kinsta.com/blog/gmail-smtp-server/

 

Link to comment
Share on other sites

Thanks for both answers, I tried both ways. TNG says the emails are sent. They don’t arrive at the destination, I also checked the SPAM folder for each account.

Link to comment
Share on other sites

I am adding more information to help with understanding my issue.

I am running TNG on two different servers, the first is my test server which is a Mac laptop OS 10.14.5 running php 7.4. The second is connected to the internet on a Synology NAS web server also running php 7.4.

My problem is on both servers the email function will not work, that includes the “Contact Us” feature on the home page. I have been working on this for days. I have tried not using SMPT to what I think is every combination of SMPT server options found on Google’s help page.

When I try to use the “Contact Us’ feature on the home page I get a reply that says “We're sorry, but your message could not be delivered. Please contact Our Family History directly at.”  And when I try to email the users from the Admin users page I get the reply “Your e-mail message has been sent..”

Any suggestions would be helpful. I can edit php code if needed.

Thanks in advance

Mark

Link to comment
Share on other sites

In general does email work on the Synology box or the Mac? I.e. can you send and receive email on the web servers outside of TNG?  Do you have firewalls running at all that might block the ports outbound etc?

Link to comment
Share on other sites

I am able to email from the Synology server via the DMS notification feature and from the Mac using email client software. There are no firewalls that I see running. What I need to test is a basic php email script on both servers, I may end up have to write my own code if I can’t find one on the internet.

Thanks

Link to comment
Share on other sites

I was playing with the TNG email stuff a few days ago trying to get it to work with my Microsoft 365 business email ... and managed to figure out that TNG uses the standard sendmail and smtpmail PHP routines ... and you can enable debug to output email sending results to the screen.  It didn't help me but it was interesting and at least led me in the direction of figuring out what might be wrong.

You can enable debug in the tngmaillib.php file after line 20 and a new line $mail->SMTPDebug = 4; so it says:

$mail = new PHPMailer\PHPMailer\PHPMailer($options);
$mail->SMTPDebug = 4;

That should output the most verbose logging messages to the screen and that might help you to figure out what is going on at least ... and hopefully to a resolution.

Anyway TNG is using the standard php email routines of class.phpmailer.php and class.smtp.php though they seem to be a few versions old.  In any case investigating that might help solve your problems.

Jeff

 

Link to comment
Share on other sites

This works for me, and for many other TNG users...

image.png

if you're hosted at Simply Hosting

Put the eMail address in the top box

and again in the box for mail username

Password in the last box.

For GMail these settings should work

 

Quote

 

How to find the SMTP Server for Gmail?

To find the SMTP server, you can use the details that are mentioned below:

  • Gmail SMTP server address: smtp.gmail.com
  • Gmail SMTP name: Your full name
  • Gmail SMTP username: Your full Gmail address (e.g., you@gmail.com)
  • Gmail SMTP password: The password that you use to log in to Gmail
  • Gmail SMTP port (TLS): 587
  • Gmail SMTP port (SSL): 465

 

I used to use that with TNG on the Server I ran from my basement.

Roger

Link to comment
Share on other sites

The problem is Google is not accepting my credentials using TNG. I wrote the Google community and was sent a reply that I needed to use the Google app password. Does anybody else use the Google app password? It requires you use the two step verification method. But if you use a phone you only need one password which unlocks your two step deal. This seems silly to me, can anybody help me better understand what is going on?
Thanks in advance.

Link to comment
Share on other sites

Yes, I have set up Google app passwords for things in the past - I don't remember what they are, but I remember having used it somewhere in the past.

Roger

Link to comment
Share on other sites

  • 2 months later...

Tags:  [Synology]  [Gmail SMTP]  [PHP 7.4]  [TNG 12.x]  [App Password]

If you have 2-Factor Authentication enabled on your Google (gmail) account, you must create an App Password to send mail through TNG.

To create a Google App Password:

  1. In upper right corner of the google or gmail website, click your round Avatar icon then select Manage Your Google Account.
  2. Select Security in the left-hand navigation bar.
    image.png

     
  3. Scroll down to the How You Sign in to Google section, and click the arrow on the right side of the 2-Step Verification item.
    image.png

    (You may be required to log-in using the Google (gmail) account you wish to use with TNG.)

     
  4. Scroll to bottom of the page and select App passwords.
  5. Click the right-hand arrow or the "Create" button.
    image.png


     
  6. When creating a new App Password for use with your TNG installation, select "Other" on the app drop-down menu. DO NOT select "Mail."
    image.png
    (When you select "Other", the "Device" drop-down will disappear.

     
  7. Type in a name for this App Password that helps you remember what it is and press the "Generate" button.
  8. A window will appear with your randomly-generated App Password.  Copy/Paste this somewhere because you can never retrieve it again.
    image.png

    (This does not change your Google or Gmail password for your computers or mobile devices.)

     
  9. Click "Done."
    (You may be required on your mobile device or in Gmail to Verify it was you that created the App Password.)
     
  10. As depicted in theKiwi's message above, navigate to your TNG Admin Panel -> Setup -> General Settings -> Mail and Registration and use the newly created App Password for the "mail password."  Make sure to use the same Google Account (full gmail address) for the "mail username" as well.
     
  11. This was tested with both TLS authentication (port 465) and STARTTLS (port 587).
    (I also had the same email in the "Email address" field and the "Mail username" field, and the "Send all email from address above" set to Yes.)
     
  12. Click Save at the bottom of the Mail and Registration setup page.

Give it a try by using the Contact Us link on the public home page, or select forgot password on the sign-in page to generate an outbound email from your TNG.

 

PS.  If you get an error while using TNG on Synology with Web Station, make sure to have the "openssl" extension enabled.
image.png

Link to comment
Share on other sites

Why waste time and give yourself a headache. Just ditch Google (waste of time) altogether and go with an email hosting company. Cheaper, easier and works every time. 

Link to comment
Share on other sites

Thank you for the suggestion, @edglimited. My post was a walkthrough of Google App Passwords for those users that may find it helpful.  Have a nice day.  :)

Link to comment
Share on other sites

1 hour ago, abobymous said:

My post was a walkthrough of Google App Passwords for those users that may find it helpful.

My comment wasn't aimed at you personaly, just a certain section of any community, that wake up in the morning and say to themselves, "today I'm going to make things hard for myself, nothing is going to be easy".

You would be surprised at the amount of noobs, who ask the most ridiculous questions of us at GitHub. I honestly think, they were dropped on their heads at childhood.

Link to comment
Share on other sites

5 hours ago, abobymous said:

If you have 2-Factor Authentication enabled on your Google (gmail) account,

If you expect to be able to download restricted mods from the TNG Wiki, you cannot use a 2-Factor Authentication email address for your TNG Wiki username because the MediaWiki software used on the TNG Wiki cannot reply to your authentication request

Link to comment
Share on other sites

5 hours ago, abobymous said:

If you have 2-Factor Authentication enabled on your Google (gmail) account, you must create an App Password to send mail through TNG.

Ken raises a valid point in his reply above.

Now let the fun begin, wait and watch for someone (a noob) to log into this Forum and try and come up with a workaround, to combat the 2FA, to download from the Wiki.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...