On 02/09/2017 08:51 PM, Brandon Allbery wrote:
On Thu, Feb 9, 2017 at 11:41 PM, ToddAndMargo <toddandma...@zoho.com> wrote:
I am looking at
https://github.com/retupmoca/P6-Net-SMTP

I pretty much understand everything, but
  • send($from, $to, $message, :$keep-going)

    Sends an email $message (which can be a Str or something with a Str method) from $from; and to $to (which can be either a single address or a list of addresses). If $keep-going is set, will attempt to send the message even if one of the recipients fails

1) where do I add the string (Str) above?

That's the $message parameter.
 
2) what does the ":" do in ':$keep-going" ?

It signals that that parameter is a named parameter / adverb; if you want to set it, you make the call like

    $smtp.send($from, $to, $msg, :keep-going)

or

    $smtp.send($from, $to, $msg, :keep-going(True))

3) not finding how to attach a file

Strictly speaking, that is not an SMTP function. You would use a MIME module to generate $message with an attached file. (This would likely be an example of $message not being a Str; it would be some kind of MIME object which let you add or reference attachments, and had a .Str method to generate the actual encoded message to be sent over SMTP.)

(SMTP is a network protocol. It doesn't even necessarily need to be mail, although that is by far its most common usage. It only handles plain text. MIME is the specification for including attachments and formatted text / HTML / etc., and how those things are encoded as plain text and decoded for viewing or extraction.)


Hi Brandon,

I feel silly missing $message.  I am really tired.

Thank you!

-T

Reply via email to