The only example of using the SMTPClient package I could find was on https://rosettacode.org/wiki/Send_email#Julia.
I adapted it a bit to test but gets a segmentation fault on Version 0.6.2:
addbrackets(s) = replace(s, r"^\s*([^\<\>]+)\s*$", s"<\1>")
function wrapRFC5322(from, to, subject, msg)
timestr = Libc.strftime("%a, %d %b %Y %H:%M:%S %z", time())
IOBuffer("Date: $timestr\nTo: $to\nFrom: $from\nSubject: $subject\n\n$msg")
end
function sendemail(from, to, subject, messagebody, serverandport;
cc=[], user="", password="", isSSL=false, blocking=true)
opt = SendOptions(blocking=blocking, isSSL=isSSL, username=user, passwd=password)
send(serverandport, map(s -> addbrackets(s), vcat(to, cc)), addbrackets(from),
wrapRFC5322(addbrackets(from), addbrackets(to), subject, messagebody), opt)
end
sendemail("to@example.com", "from@example.com", "TEST", "hello there test message text here", "smtp: localhost",
user="from@example.com", password="example.com")
I want to use the localhost on port 25 without authentication to send out email. How do I do it?