3

I am new to REBOL. People blogging about how great REBOL is used sending an email as an example, similar to this example from the "send" documentation:

send luke@rebol.com "Testing REBOL Function Summary"

having read how easy and convenient it is to do this, I excitedly tried to send myself a test email via my GMail account.

I looked at the official GMail help for SMTP/POP to get the relevant SMTP/POP server names: https://support.google.com/mail/answer/7104828?hl=en

And here is how far the "send" and "set-net" documentation got me:

>> set-net [ myrealusername@gmail.com smtp.gmail.com pop.gmail.com ]
>> send myrealusername@gmail.com "Hello me!"
connecting to: smtp.gmail.com
** Access Error: Cannot connect to smtp.gmail.com
** Where: open-proto
** Near: smtp-port: open [scheme: 'esmtp]
either only

On reflection, of course it didn't work; I told REBOL nothing about wanting to use SSL/TLS, the relevant port numbers, or my GMail password. It must need all of the above to actually send an email.

So how do I do it?

dukereg
  • 722
  • 5
  • 16

1 Answers1

5

I modified the protocols some years ago to work with gmail. I hope that they still work.

You'll need to run both the prot-ssmtp.r and prot-ssend.r, and you'll need a version of rebol2 which supports ssl. This is either a free view build, or a paid core build.

do https://raw.githubusercontent.com/gchiu/Rebol2/master/Protocols/prot-ssmtp.r
do https://raw.githubusercontent.com/gchiu/Rebol2/master/Protocols/prot-ssend.r

Now, you can either set the user and password manually:

system/schemes/esmtp/user: "username"
system/schemes/esmtp/pass: "password"

or, when the script runs the very first time, you will be asked the values so that they can be set for that rebol instance. The prot-ssmtp uses port 465 but you can modify that if it's no longer correct.

And then it should be as straight forward after setting set-net as:

ssend email@someon.com "This is my message"

Note that we now have email on ren-c which is the open source fork of rebol3.

Graham Chiu
  • 4,856
  • 1
  • 23
  • 41
  • Thanks, but there was no prompt to set user and password when I ran those scripts, nor when I invoked ssend. How do I manually set the user and password? (It's not mentioned in the REBOL SMTP doco and I tried something similar to the POP address which also didn't work: ssend username:password@gmail.com "hello me") – dukereg Mar 18 '17 at 22:07
  • Ok, added code to set the user/pass manually. I guess I never implemented the ask user for those details. And parsing out the username won't work in send username:password@gmail.com since the username also contains the "@" character. – Graham Chiu Mar 18 '17 at 22:17
  • @user310291 you need to ask another question. – Graham Chiu May 27 '18 at 07:19