unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: Chris Vine <chris@cvine.freeserve.co.uk>,
	 Konrad Makowski <poczta@konradmakowski.pl>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: guile - sending emails
Date: Mon, 20 Oct 2014 23:13:21 +0000 (UTC)	[thread overview]
Message-ID: <1634516074.236902.1413846801081.JavaMail.yahoo@jws100159.mail.ne1.yahoo.com> (raw)
In-Reply-To: <20141020221356.78e4d4e0@bother.homenet>

> On Monday, October 20, 2014 2:14 PM, Chris Vine <chris@cvine.freeserve.co.uk> wrote:

> > On Mon, 20 Oct 2014 22:17:47 +0200
> Konrad Makowski <poczta@konradmakowski.pl> wrote:
>>  How can i send emails from guile script? Is there any module for that 
>>  purpose? I know that there is mailutils but can't figure out how to
>>  do that with it. Please, show me some examples.


I've never actually looked at GNU Mailutils before, so I didn't
know it has a scheme interface.  Sweet.  Has anyone been using it?

Just for fun, I added the missing options to guile-curl that would
allow one to send an e-mail.  If one checked out the very latest
git at ...

  https://github.com/spk121/guile-curl

...one could do something like the following.  But, that is a bit
crap.  A proper library would handle the bookkeeping of the
many names, addresses, and dates appear multiple times in
SMTP headers.


Regards,
Mike Gran


---

(use-modules (curl))

(setlocale LC_ALL "")

(define data-port
  (open-input-string
    (string-append
      "From: \"John Doe\" <jdoe@yahoo.com>\r\n"
      "To: \"John Smith\" <jsmith@nobody.com>\r\n"
      "Subject: Test Message\r\n"
      "\r\n"
      "This is the body of my mesage.\r\n")))

(define handle (curl-easy-init))
(curl-easy-setopt handle 'url "smtps://smtp.mail.yahoo.com:465")
(curl-easy-setopt handle 'verbose #t)
(curl-easy-setopt handle 'use-ssl CURLUSESSL_ALL)
(curl-easy-setopt handle 'username "jdoe@yahoo.com")
(curl-easy-setopt handle 'password "xxxxx")
(curl-easy-setopt handle 'mail-from "jdoe@yahoo.com")
(curl-easy-setopt handle 'mail-rcpt '("jsmith@nobody.com"))
(curl-easy-setopt handle 'readdata data-port)
(curl-easy-perform handle)



  reply	other threads:[~2014-10-20 23:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20 20:17 guile - sending emails Konrad Makowski
2014-10-20 21:13 ` Chris Vine
2014-10-20 23:13   ` Mike Gran [this message]
2014-10-30 10:30     ` ftp uploading files Konrad Makowski
2014-10-30 12:59       ` Mike Gran
2014-10-21  3:30 ` guile - sending emails Nala Ginrut
2014-10-23 11:15   ` Konrad Makowski
2014-10-23 18:04     ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1634516074.236902.1413846801081.JavaMail.yahoo@jws100159.mail.ne1.yahoo.com \
    --to=spk121@yahoo.com \
    --cc=chris@cvine.freeserve.co.uk \
    --cc=guile-user@gnu.org \
    --cc=poczta@konradmakowski.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).