Bugs: Browse | Submit New | Admin

[#28136] The email body is being parsed twice

Date:
2010-04-24 16:55
Priority:
3
Submitted By:
shreyas satish (shreyas123)
Assigned To:
Nobody (None)
Category:
Interface (example)
State:
Open
Summary:
The email body is being parsed twice

Detailed description
I use the following script to receive email . TMail parses the from_email and email subject correctly but the email
body is parsed twice.As a result whatever is in the email body is printed out twice.

def get_mail
  Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_NONE)  
  Net::POP3.start('pop.gmail.com', 995, "uname","pass") do |pop|  
  mail_header=[];mail_subject=[];mail_body=[];mail_from=[]
    unless pop.mails.empty?
       pop.each_mail do |mail|  
        email = TMail::Mail.parse(mail.pop)
        mail_subject =  email.subject
        mail_body =  email.body
        mail_from = email.from
        email_obj=EmailedQueries.new
        email_obj.save_email(mail_from, mail_subject, mail_body)          
        end 
    end
 end   
end

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item