cURL / Mailing Lists / curl-library / Single Mail


Re: SMTP : Subject field

From: Jamie Lokier <>
Date: Mon, 12 Apr 2010 19:10:18 +0100

Daniel Stenberg wrote:
> On Mon, 12 Apr 2010, wrote:
> >Which option can help me populate the "Subject" field?
> None, that's part of the body you send.

Right, that is how SMTP works and how sendmail usually works.

> >Also, currently when the mail is sent, I dont see the recipient mail id
> >in my mailbox? Are there options that can help me populate all fields
> >(To,CC,BCC..) ?
> Those are also headers you are in charge of. In fact, all *headers* in the
> mail are your responsibility. Only the stuff that SMTP requires for plain
> SMTP commands are done by libcurl.

It'd probably be quite useful for SMTP mail sending to set mail
headers in a similar way to HTTP headers, with the mail body being the
message itself. There's quite a close relationship between SMTP mail
and HTTP messages, and formatting mail headers correctly for SMTP does
need a bit of technical know-how which is probably beyond many of the
people who'd like to use it, so it makes sense.

The SMTP protocol elements are sometimes modelled as additional
"envelope" pseudo-headers, which I think would work well. Especially
if they are populated by default from mail headers. But then there is
a risk of doing too much and getting some of it wrong, which should be
checked and configured in a proper mail client instead.

-- Jamie
List admin:
Received on 2010-04-12