Re: Net::SMTP attachments?
Well, tastes can reasonably differ on that point. Bunging all of the complexity, of implementation, of design tradeoffs, and of documentation, into one big module might suit some tastes. Not mine, as either an implementor or a user. Not all uses need all components, and I for myself would rather implement, or learn to use, or need to maintain, one simpler component at a time.
Re: Net::SMTP attachments?
On 03/01/2017 01:27 PM, Brandon Allbery wrote: On Tue, Feb 28, 2017 at 4:04 PM, ToddAndMargo> wrote: Anyone know how to do an attachment with Net::SMTP. Didn't you ask that a couple months ago, and I told you to look for a MIME module? Yes, but it didn't sink in. I am starting to think that Net::SMTP and other low level modules need to be buried somehow; people tend to think of sending an email with a subject and an attachment as one thing, when the implementation actually involves three independent protocols one wrapped around another (SMTP, core email, MIME), and the result is various people will always be expecting one of those levels to be all three. Agreed. It would be nice to have a high level module to do all this.
Re: Net::SMTP attachments?
On Tue, Feb 28, 2017 at 4:04 PM, ToddAndMargowrote: > Anyone know how to do an attachment with Net::SMTP. Didn't you ask that a couple months ago, and I told you to look for a MIME module? I am starting to think that Net::SMTP and other low level modules need to be buried somehow; people tend to think of sending an email with a subject and an attachment as one thing, when the implementation actually involves three independent protocols one wrapped around another (SMTP, core email, MIME), and the result is various people will always be expecting one of those levels to be all three. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
Re: Net::SMTP attachments?
On 03/01/2017 12:03 PM, yary wrote: On Wed, Mar 1, 2017 at 3:01 PM, yary> wrote: On Wed, Mar 1, 2017 at 2:54 PM, ToddAndMargo > wrote: MIME::Lite Sorry not MIME::Lite but "a number of alternatives, like Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead. " -y Thank you! I have some research to do! -- ~~~ Serious error. All shortcuts have disappeared. Screen. Mind. Both are blank. ~~~
Re: Net::SMTP attachments?
On Wed, Mar 1, 2017 at 2:54 PM, ToddAndMargowrote: > MIME::Lite That's the key- use MIME::Lite to build the headers and body of an email that has an attachment. Then use Net::SMTP, either the perl5 or perl6 version, to send it. SMTP knows nothing about attachments. MIME::Lite takes all the bits that need to be packaged into a "rich" message and creates a long string, full of headers and body,. that you can hand to an SMTP server to deliver. -y
Re: Net::SMTP attachments?
On Tue, Feb 28, 2017 at 10:04 PM, ToddAndMargo> wrote: Hi All, Anyone know how to do an attachment with Net::SMTP. I need to attach a tar ball. I see this is Thunderbird's message source, but .. --0__=0ABB0A53DFD693F18f9e8a93df938690918c0ABB0A53DFD693F1 Content-type: image/gif; name="pic15602.gif" Content-Disposition: attachment; filename="pic15602.gif" Content-transfer-encoding: base64 Many thanks, -T -- ~~~ Having been erased, The document you're seeking Must now be retyped. ~~~ On 03/01/2017 01:51 AM, Fernando Santagata wrote: Hi, Net::SMTP manages the SMTP protocol: the email transfer from one server to the next one; it doesn't "build" an email. As far as I can see, there's no Perl6 module to create a MIME email, such as the MIME::Lite Perl5 module. This doesn't mean that there's no way to do that using Perl6: you can always use Inline::Perl5 to load the Perl5 module and transparently use it in your program. HTH -- Fernando Santagata Hi Fernando, I have been looking at how to do this over on Perl 5's Net::SMTP. It has something to do with the data command and you providing your own headers. I am not the first one to have asked this question. I will keep looking. Thank you for the help! -T
Re: pod question
On 03/01/2017 03:50 PM, Will Coleda wrote: Not true, '=for' is part of POD6. See below. If you're getting errors, it's helpful to reduce the example to a reasonably small bit of code that duplicates the same error; either you'll realize the issue as you remove unrelated bits of code, or you'll end up with an example that epitomizes the problem you're facing. $ cat foo.p6 =for comment This is a comment say "hi"; $ perl6 foo.p6 hi Hi Will, I've tried it out and found my mistake. I continued typing after the first word like so =for head1 abc def instead of =for head1 abc def Many thanks, Marcel
pod question
Hi, Is it true that the '=for' is taken out of the pod language? I get errors when I use it. It should take the line and the next lines as a block. I've also seen that it has the same effect now when I don't use it. Regards, Marcel
Re: pod question
Not true, '=for' is part of POD6. See below. If you're getting errors, it's helpful to reduce the example to a reasonably small bit of code that duplicates the same error; either you'll realize the issue as you remove unrelated bits of code, or you'll end up with an example that epitomizes the problem you're facing. $ cat foo.p6 =for comment This is a comment say "hi"; $ perl6 foo.p6 hi
Re: Net::SMTP attachments?
Hi, Net::SMTP manages the SMTP protocol: the email transfer from one server to the next one; it doesn't "build" an email. As far as I can see, there's no Perl6 module to create a MIME email, such as the MIME::Lite Perl5 module. This doesn't mean that there's no way to do that using Perl6: you can always use Inline::Perl5 to load the Perl5 module and transparently use it in your program. HTH On Tue, Feb 28, 2017 at 10:04 PM, ToddAndMargowrote: > Hi All, > > Anyone know how to do an attachment with Net::SMTP. > I need to attach a tar ball. > > I see this is Thunderbird's message source, but .. > > > --0__=0ABB0A53DFD693F18f9e8a93df938690918c0ABB0A53DFD693F1 >> Content-type: image/gif; >> name="pic15602.gif" >> Content-Disposition: attachment; filename="pic15602.gif" >> Content-transfer-encoding: base64 >> > > > Many thanks, > -T > > -- > ~~~ > Having been erased, > The document you're seeking > Must now be retyped. > ~~~ > -- Fernando Santagata
Re: for loop index question
On 02/28/2017 11:06 PM, Andrew Kirkpatrick wrote: The zip operator in this case takes two sequences and interleaves them into a single sequence. It might be useful if you have handy or can generate a list of keys and a list of values you want to put together in pairs using => to create a hash table. Your explicit approach makes sense for readability - it can aid comprehension if a fake address looks like a real one. Thank you!
Re: for loop index question
On 03/01/2017 12:45 AM, Richard Hainsworth wrote: Todd, As Andrew explained Z takes two arrays and an operator, eg. =>, or +, and then 'runs' the operator on the elements of the two lists. Here, you defined @x as a list of strings. I defined two lists, one of keys and one of values. Then I zipped the two together with the => operator that associates keys with values. Personally, I find %h = Z=> as easier to read. I am happy not to have () and "" and ',', and the problems of matching them, cluttering the line. I think that the fewer the characters there are, the clearer it is to see the relationships. It depends on the code, and different code is more elegant and easier to maintain when written in a different way. But that is an opinion. It seems to me that there are a number of new idioms arising in Perl6. Eventually the more elegant and computationally efficient idioms will become apparent. From time to time, I look at the code in the modules to see if there are nicer ways to express something. I also can type almost as fast I think. But having typed, I think again, and usually rewrite to make things clearer. Thank you!