Mailfactory works great, it can send the attachments freely. http://mailfactory.rubyforge.org/
Thanks. Wesley Chen. On Sun, Jun 7, 2009 at 5:56 PM, tknv <[email protected]> wrote: > > Hello et.,al. > > I think this blog is help attach file. > Example use Gmail:SMTP. > > http://gusortiz.wordpress.com/2009/01/05/sending-mail-smtp-gmail-with-attachment-using-ruby-on-rails-actionmailer/ > > And also when I use Gmali:SMTP by ruby. > I'd used require 'smtp-tls' for using Gmail:SMTP. > There you can get:http://github.com/yzhang/smtp_tls/tree/master > > tknv/ > > On Jun 6, 2:24 am, Wesley Chen <[email protected]> wrote: > > But do you know how to send an attachment in the email? > > > > Thanks. > > Wesley Chen. > > > > > > > > On Sat, Jun 6, 2009 at 1:12 AM, Wesley Chen <[email protected]> wrote: > > > Hi, Felipe, > > > Thank you very much, it is really helpful, :). > > > There is a great contributor below. > > >http://notepad.onghu.com/2007/3/26/sending-email-with-ruby > > > When I run the code, anything goes expected. > > > > > I have searched for the results for hours, your one word gets it fixed. > :), > > > thank you again. > > > > > Thanks. > > > Wesley Chen. > > > > > On Sat, Jun 6, 2009 at 12:51 AM, Felipe Knorr Kuhn <[email protected] > >wrote: > > > > >> Did you try the following? > > > > >> SMTP< > http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP... > .>Authentication > > > > >> The Net::SMTP< > http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP....>class > supports three authentication schemes; PLAIN, LOGIN and CRAM MD5. ( > > >> SMTP< > http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP....>Authentication: > [RFC2554]) To use > > >> SMTP< > http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP....>authentication, > pass extra arguments to > > >> SMTP.start< > http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP....> > > >> /SMTP#start< > http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP....>. > > > > >> # PLAIN > > >> Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain', > > >> 'Your Account', 'Your Password', :plain) > > >> # LOGIN > > >> Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain', > > > > >> 'Your Account', 'Your Password', :login) > > > > >> # CRAM MD5 > > >> Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain', > > >> 'Your Account', 'Your Password', :cram_md5) > > > > >> 2009/6/5 Wesley Chen <[email protected]> > > > > >> Hi, Guys, > > >>> I can read my sina.com email by the following code: > > >>> require 'net/pop' > > >>> Net::POP3.foreach('*pop3.sina.com.cn*', 110, > > >>> '[email protected]', 'my_password' ) do |email| > > >>> hdr = email.header > > >>> if hdr =~ /\d+/ > > >>> language = hdr.to_s > > >>> else > > >>> language = "INVALID" > > >>> end > > >>> puts language > > >>> end > > > > >>> I would like to send email by *smtp.sina.com.cn*, there is code on > the > > >>> net: > > > > >>> Net::SMTP.start('smtp.sina.com.cn',25) do |smtp| > > >>> smtp.send_message "hello", '[email protected]', ['[email protected] > '] > > >>> end > > >>> But I get error message: > > >>> *e:/ruby/lib/ruby/1.8/net/smtp.rb:680:in `check_response': 530 > > >>> Authentication required (Net::SMTPUnknownError)* > > > > >>> So, how can make it I can send the email by the ruby code? > > > > >>> Any suggestion would be quite appreciated. > > > > >>> Thanks. > > >>> Wesley Chen. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
