4
$\begingroup$

Running Wolfram Desktop on Linux with settings

enter image description here

and running

SendMail["my.gmail.usernamel@gmail.com", "Here is the body of the \
message."]

I get either

JavaNew: Incorrect number or type of arguments to constructor for class \
com.wolfram.externalservice.email.SMTP. The arguments, shown here in \
a list, were {smtp \
,Null,imap.gmail.com,25,True,my.gmail.username@gmail.com,$Failed,False,\
True,20703670044490234882.0.WolframLanguage.my.gmail.username@gmail.com}\
.

or sometimes just a flat out

enter image description here

How do I sync Wolfram up to gmail? Or is there some alternate way of sending emails to a specified email address from Wolfram?

$\endgroup$
2
$\begingroup$

Here how to set up Google's outgoing mail (SMTP) server from Google Help. The error shows that you're trying to connect to port 25, and that's the wrong setting.

The first step is to sign in at gmail.com, and check that IMAP is turned on for your account. Sign out of gmail.

Follow the instructions to set the Mail Settings preferences in Mathematica. Enter your password at the Incoming tab.

Added: Google IMAP limits and troubleshooting

As of May 2020, Google limits accounts to 2500 MB per day for IMAP downloads and 500 MB per day for IMAP uploads. Exceeding these limits may cause a temporarily lockout.

There’s a limit of 15 IMAP connections per account. If you use multiple email clients or devices for the same Gmail account, try closing or signing out of some.

The Google Help troubleshooting notes that email applications may try to download too many emails at one time, and recommends:

  • Update Gmail IMAP settings so you don't sync certain folders.
  • In Gmail IMAP settings, set IMAP to only sync folders with 10,000 emails or fewer.
  • Make sure your mail application isn't set to check for new email too frequently. If your mail application checks for new messages more than once every 10 minutes, access to your account could be blocked.

Remarks

Mathematica doesn't seem to have an preference setting to limit IMAP downloads. Large gmail folders could exceed the daily download limit.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ I followed the instructions in your link, and it worked for a few SendMail's, until it started to yield this error. $\endgroup$ – George May 7 at 2:57
  • 1
    $\begingroup$ @George, the error message is cryptic and not helpful. It doesn't indicate anything except that the connection failed. I added some information, and troubleshooting steps from Google. $\endgroup$ – creidhne May 7 at 14:56
  • 1
    $\begingroup$ I figured out the issue. If I use the MailSettings (described in Wolfram's documentation) to completely specify my email (username, password, SSL preference, etc), then I can send unlimited messages through Wolfram via GMail. $\endgroup$ – George May 7 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.