I have the following code, it is sending text message. I want to attach a file. How to do that?
require 'net/smtp' # plain mail
smtpclient = Net::SMTP::new( '192.168.1.1' ) # create new object to send mail
the_email="From : ruby_using_smtp @webdevel.co.in \nTo:xxxx@bksys .co.in\nSubject :Birthday \n\n"+"This is for demo" #Frame a mail
smtpclient.star t # start the mail process
smtpclient.send mail(the_email, 'ruby_using_smt p@webdevel.co.i n','xxxx@bksys. co.in') # send mail via ruby
smtpclient.fini sh # operation finished.
puts "Mail sent Successfully "
require 'net/smtp' # plain mail
smtpclient = Net::SMTP::new( '192.168.1.1' ) # create new object to send mail
the_email="From : ruby_using_smtp @webdevel.co.in \nTo:xxxx@bksys .co.in\nSubject :Birthday \n\n"+"This is for demo" #Frame a mail
smtpclient.star t # start the mail process
smtpclient.send mail(the_email, 'ruby_using_smt p@webdevel.co.i n','xxxx@bksys. co.in') # send mail via ruby
smtpclient.fini sh # operation finished.
puts "Mail sent Successfully "
Comment