Jump to content

Send email: Difference between revisions

factor email example actually works now
(factor email example actually works now)
Line 348:
This one uses the build-in SMTP vocabulary. Note that 'to' and 'cc' need to be arrays of strings containing an email address.
 
<lang Factor>
USING: kernel accessors smtp io.sockets locals namespaces smtp ;
IN: learnscratchpad
:: send-mail ( fromf tot ccc subjects bodyb -- )
default-smtp-config "smtp.gmail.com" 587 <inet> smtp->>server set
: send-mail ( from to cc subject body -- )
smtp-t >>tls? on
"smtp.gmail.com" 587 <inet> smtp-server set
"my.gmail.address@gmail.com" "qwertyuiasdfghjk" <plain-auth>
smtp-tls? on
>>auth \ smtp-config set-global <email> f >>from t >>to
"noneofyourbuisness@gmail.com" "password" <plain-auth> smtp-auth set
c >>cc s >>subject b >>body send-email ;</lang>
<email>
swap >>from
swap >>to
swap >>cc
swap >>subject
swap >>body
send-email ;</lang>
 
=={{header|Fantom}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.