Why won't mail merge connect to my outgoing email server?

Hi. I’ve been having a lot of problems trying to get mail merge to work and send emails. I’ve tried Libre Office 3.5 and 4.0, though I don’t think anything has changed between them with regard to mail merge.

I can’t seem to get LibreOffice to speak to my mail server. I’ve tried both my gmail and internode servers. I set the settings to be the same as my thunderbird settings, and I can send emails from thunderbird without a problem.

My internode settings match those on the web page (mail.internode.on.net, imap port 993, smtp port 465). I’ve tried a few different settings for google, as there seems to be a few around. I’ve tried smtp.gmail.com and smtp.googlemail.com, port 465, 587 and 578 as outgoing in various different combinations. I’ve also tried imap.gmail.com and imap.googlemail.com with port 993 as incoming.

There are some posts and bugs on the subject, but from what I read these problems were fixed before 3.5, and there is no fix remaining that I have found to try.

For the most part, when I either try to send mail or test settings, LO freezes for approximately half an hour, and then fails. On one occasion, I didn’t select SSL, and the test passed (very quickly). I had two green ticks. However, when I tried to send email, it failed.

Has anyone gotten mail merge to work to email recently, preferably with a gmail or internode account? Is there something else I maybe should be thinking of? The job is starting to get rather urgent. I’d include the error, but I have to wait half an hour, as I just kicked it off again. I’ll edit this post later.

EDIT:
Here is the error I get (after about half an hour) when I have all of my settings in place.

LibreOffice could not connect to the outgoing mail server. Check your system's settings and the settings in LibreOffice. Check the server name, the port and the secure connections settings
--
<class 'imaplib.IMAP4.abort'>: socket error: EOF, traceback follows
  C:\Program Files\LibreOffice 4.0\program\python-core-3.3.0\lib\imaplib.py:1068 in function _get_line() [raise self.abort('socket error: EOF')]
  C:\Program Files\LibreOffice 4.0\program\python-core-3.3.0\lib\imaplib.py:969 in function _get_response() [resp = self._get_line()]
  C:\Program Files\LibreOffice 4.0\program\python-core-3.3.0\lib\imaplib.py:202 in function _connect() [self.welcome = self._get_response()]
  C:\Program Files\LibreOffice 4.0\program\python-core-3.3.0\lib\imaplib.py:173 in function __init__() [self._connect()]
  C:\Program Files\LibreOffice 4.0\program\mailmerge.py:305 in function connect() [self.server = imaplib.IMAP4(server, port)]

Thanks in advance!

The same problem. When trying to connect mailserver by options → writer → mail merge … Libreoffice crashes completely with white screens and no further reaction. Tested with 4.* under win7 and linux-mint.

I have same problem! Ver 4.2.1

The stacktrace shows the error is raised because the response at connection time is ‘not as expected’. This, and the long time it takes before an error appears suggests LibreOffice cannot connect to the server. For connection problems, some of the possible causes are: the server is offline (which is unlikely for Gmail), the connection details are incorrect (server address, port), the computer is not connected to the internet or LibreOffice is blocked by a firewall.

Although you wrote you tried several combinations of servers addresses and port numbers, the combination mentioned in this bug report worked for me on Windows 7 with LibreOffice 4.1.4.2, without changing firewall settings. I used these settings (where xyz@gmail.com is my Gmail address):

  • E-mail address: xyz@gmail.com
  • Server name: smtp.googlemail.com
  • Port: 587
  • Use secure connection (SSL): checked
  • in the Server Authentication dialog:
  • The outgoing mail server (SMTP) needs authentication: checked
  • The outgoing mail server (SMTP) needs separate authentication: selected
  • user name: xyz@gmail.com (same as the email address)
  • password: a newly generated application-specific password, because I have 2-step authentication enabled

How to create an application-specific password is explained by Google in this help item.

Probably unrelated to your problem, and I haven’t checked, but it would make sense to me that Google only allows email addresses that are registered with the account as sender address. How to enable the use of other addresses is covered in this help item.

+1 : Same problem with LO 5.0.0.5 freshly installed on a box running Ubuntu 14.04.3 LTS as OS.
Using Mozilla Thunderbird’s settings for the outgoing smtp server, i.e. port 465, and checking “the outgoing mail server uses the same authentication as the incoming mail server” DOES NOT WORK.
Instead the correct email merge settings are: outgoing mail server port 587 (as suggested here) and check the server authentication’s option: “the outgoing mail server (SMTP) requires separate authentication.”

I had the same problem and I cannot figure out the way to use my Gmail account.
Then when I did the debug of the file mailmerge.py (in Linux at /usr/lib/libreoffice/program/mailmerge.py) I discovered that the SSL layer for secure connections isn’t handled properly.
At the line where the SMTP server is invoked I found:

self.server = smtplib.SMTP(server, port,timeout=tout)

but in case of SSL connection the following statement should be used:

self.server = smtplib.SMTP_SSL(server, port,timeout=tout)

So, it’s enough to make this simple correction to have Gmail SMTP (mine is smtp.gmail.com) on port 465.
I even didn’t need to tick the “Use SSL” checkbox in the mailmerge user interface configuration.

Cheers,

Andrea

Did you file a bug report or submit a patch too? That would be great!

I have the same problem and found the reason: I have more than 2 email accounts (one personal gmail, and one company google apps). Adding both account and set defaul sending account solved the problem.
Anh Han