Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET POP3

 AfterLogic Forum : MailBee.NET POP3
Subject Topic: read email’s body contnet Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 12 March 2008 at 9:23am | IP Logged Quote sandya

Hi,i need to read email's body content.Body content is in html.
here is email body structure

FirstName:Ed
LastName:Silvester
CompanyName:
Address:15 Rosedene Avenue
Address2ndLine:
Town:Greenford
County:
CountryCode:GB
Postcode:UB6 9SB
Telephone:
Email:ed.silvester@simplymedia.tv
ShippingFirstName:Ed
ShippingLastName:Silvester
ShippingAddress:15 Rosedene Avenue
ShippingAddress2ndline:
ShippingTown:Greenford
ShippingCounty:
ShippingCountryCode:GB
ShippingPostcode:UB6 9SB
OrderNumber:374/120308/12
ShopsNameSimplyTV Shop
URL:http://www.simplytv.co.uk
Custom:How did you hear about us?: newsletter
Gender: Male
Age Group: 18-25
keep me posted on special offers and news letters from SimplyTV: Yes
Your Broadband Provider:: Mickeymouse interent

package:Your Order Details...

------------------------------------------------------------ ------------

Description: Wi-fi Simply Set Top Box for watching TV on the internet.
Item Price: GBP 99.00
Qty: 1
Delivery: GBP 10.00
Total: GBP 109.00

------------------------------------------------------------ ------------
Description: Russian Channel Package
Item Price: GBP 15.00
Qty: 1
Total: GBP 15.00

------------------------------------------------------------ ------------

Sub Total: GBP 97.02
Tax @ 17.5%: GBP16.98
Delivery: GBP 10.00

Total: GBP 124.00

paymentmethod:Online Credit Card

i need to read Firstname and second name unil email.how i need to iterate and read these content.i am working with MailBee.net objects.i got stucked to read.if it is working fine we are going to by your product.First i am testing as a 30 days trial.can u please help me,if you can send me any code much appreciated
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 13 March 2008 at 2:06am | IP Logged Quote Andrew

We inserted the data you provided into .eml file and implemented the following sample to get LastName and ShippingAddress values (C# syntax):

Code:
string lastName = "";
string shippingAddress = "";

MailMessage msg = new MailMessage();

msg.LoadMessage(@"D:\test.eml");

msg.Parser.HtmlToPlainMode = HtmlToPlainAutoConvert.IfNoPlain;

string[] lines = msg.BodyPlainText.Split('\n');

foreach(string line in lines)
{
    string[] tokens = line.Trim().Split(':');

    if (tokens[0].Trim() == "LastName")
    {
        lastName = tokens[1].Trim();
    }
    else if (tokens[0].Trim() == "ShippingAddress")
    {
        shippingAddress = tokens[1].Trim();
    }
}

MessageBox.Show(lastName);
MessageBox.Show(shippingAddress);



Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 13 March 2008 at 3:51am | IP Logged Quote sandya

Thank you for your reply.I think it looks good,i am going to develop that way.How to create LoadMessage.i try to created but i am getting error.My error is like this IOException occurred. InnerException message follows: Could not find file 'C:\Sandy_Email\test.eml'.
i want to read the messages in our mail every five minutes.what is the best way can u suggest me on this.I thought that i need to create windows service put on timer control.or else is there any inn webapplication whenever the mail comes we need to read unread mails.is there any way to possible to do this on MailBee.net objects.i need your help.Can u please tell me.And also tell me that how to write LoadMessage and put msg into .eml file .Thanks for your quick help on above.
Back to Top View sandya's Profile Search for other posts by sandya
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 13 March 2008 at 4:16am | IP Logged Quote sandya

How to insert the data into eml file whenever the mail comes.
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 13 March 2008 at 4:45am | IP Logged Quote Andrew

Quote:
IOException occurred. InnerException message follows: Could not find file 'C:\Sandy_Email\test.eml'.


This means exactly what it says, i.e. this file doesn't exist.

Quote:
i want to read the messages in our mail every five minutes.what is the best way can u suggest me on this.I thought that i need to create windows service put on timer control.or else is there any inn webapplication whenever the mail comes we need to read unread mails.is there any way to possible to do this on MailBee.net objects.i need your help.Can u please tell me.


This can be implemented in various ways: windows application, windows service, web application, etc. Depends on your requirements.

To learn how to download new messages from POP3/IMAP account, please refer to this topic of our forum.


Quote:
how to write LoadMessage and put msg into .eml file
How to insert the data into eml file whenever the mail comes.


You can save message to an .eml file via MailMessage.SaveMessage method.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 13 March 2008 at 6:18am | IP Logged Quote sandya

Hi Andrew thanks for ur reply,i appreciate your help.My requirement is like this.We will get mails whenever user register with our site.we need to take user details and save into our database.our apllication needs to be run whenever the new mail comes.Is it possible in webapplication using unique id concept.whenever mail comes is our web application run.What is the best method.Could you please suggest me on this?
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 13 March 2008 at 7:11am | IP Logged Quote Andrew

POP3 protocol doesn't allow your application to learn if a new message arrived. Once you connected to a POP3 mailbox, you got a snapshot of current mailbox state and it won't change (even if new mails just arrived) until you disconnect from the mailbox and connect again. So, to know about arriving new messages, your application have to periodically poll POP3 mailboxes.

In case of IMAP, it's possible to learn about arriving new messages without polling mailbox if your IMAP server supports IDLE extension. However, this requires keeping connection to IMAP server permanently alive.

So, standard e-mail protocols doesn't allow running application when a new message arrives. You need your mail server to trigger your application, but this is not related to MailBee.NET Objects (they able to send/receive/parse/build messages, but not able to run applications), you should refer to your mail server documentation to learn how to implement triggering of such kind.

Perhaps, this Wikipedia article would be useful for you.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 13 March 2008 at 8:28am | IP Logged Quote sandya

Thank you for your reply,really its quick response.Great job.I think it will be better to develop an application in windows services by keeping timer control.
Back to Top View sandya's Profile Search for other posts by sandya
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 14 March 2008 at 10:05am | IP Logged Quote sandya

Hi,Can u please tell me how to read above mail.i could read upto shipping details.but i want to read Descriptions and their prices also.Every time order of description is not same.it could be Russian Channel package and wi-fi set top box and russian basic channel package and russian entertainment package these are the descriptions for packages and corresponding prices.I need to store all these values into our database.How to read package names and corresponding prices.Every time order is not same so i am getting error as i am reading through above method what you said.Could you please tell me the way to do.I need to your help.
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 15 March 2008 at 3:57am | IP Logged Quote Andrew

Try to add check for number of tokens in such way so non-existent tokens won't be indexed. For instance, if an element of lines array doesn't contain a colon, there will be a single token only and tokens[1] won't exist. You should just avoid accessing tokens[1] when it doesn't exist.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 17 March 2008 at 10:11am | IP Logged Quote sandya

thank u for your answer.I got the solution.
Back to Top View sandya's Profile Search for other posts by sandya
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 18 March 2008 at 6:57am | IP Logged Quote sandya

I try to deploy my application into our server.but i am getting error.i deployed my application into server.i am getting error when i try to access the page from server.
my error is:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'MailBee.NET, Version=3.0.2.79, Culture=neutral, PublicKeyToken=cd85b70fb26f9fc1' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 20:            <compilation debug="true">
Line 21:                 <assemblies>
Line 22:                       <add assembly="MailBee.NET, Version=3.0.2.79, Culture=neutral, PublicKeyToken=CD85B70FB26F9FC1"/>
Line 23:                       <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>< /compilation>
Line 24:            <!--


Source File: D:\SimplyGlobal_Website_26Server\Email\web.config   ;  Line: 22

Assembly Load Trace: The following information can be helpful to determine why the assembly 'MailBee.NET, Version=3.0.2.79, Culture=neutral, PublicKeyToken=cd85b70fb26f9fc1' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Could you please tell me if know the error why it is coming
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 18 March 2008 at 8:03am | IP Logged Quote Andrew

It seems MailBee.NET.dll is missing in the bin subfolder of your application deployed on the server. Please upload MailBee.NET.dll to the bin subfolder and try again.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 18 March 2008 at 8:52am | IP Logged Quote sandya

Hi,i have added reference to MailBee.NET.dll in my project.And for my sake after ur mail i did one more time .i deleted existing reference and add the reference again to mailBee.net.dll. Again the same error is coming.i donot know what to do.Do i need to any settings on my server.
Back to Top View sandya's Profile Search for other posts by sandya
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 18 March 2008 at 9:01am | IP Logged Quote Alex

Quote:
Hi,i have added reference to MailBee.NET.dll in my project.And for my sake after ur mail i did one more time .i deleted existing reference and add the reference again to mailBee.net.dll

You did this on your computer, not on the server, right? This means the dll was included in your project on your computer, but this has nothing to do with the server. The dll must be in /bin folder of your application ON THE SERVER.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 18 March 2008 at 9:46am | IP Logged Quote sandya

On server we donot have Visual studio.net.We have .net framework thats it.I created one folder in server.and i publish my project in my computer after that i copied the contents from PrecompiledWeb folder and i pasted all the contents into server's folder which i created.i could see bin folder but contents are in .dll,i could not see MailBee.net.dll .i donot know how to add this.dll to my bin in server.Could you please suggest me on this.I need it urgent.I need your help.
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 19 March 2008 at 2:01am | IP Logged Quote Andrew

Just copy/upload MailBee.NET.dll to the bin folder of your application on the server. You may find the .dll in the bin subfolder of your project (if the reference has "Copy Local" = True) or in MailBee.NET Objects installation folder (by default, C:\Program Files\MailBee.NET Objects).

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 19 March 2008 at 3:19am | IP Logged Quote sandya

Thank you for your answer,i found solution yesterday.
Back to Top View sandya's Profile Search for other posts by sandya
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 19 March 2008 at 4:54am | IP Logged Quote sandya

Hi,Can you please tell me why i could not send mail though i could get the message like message has been sent.
my code is here:

MailMessage msg = pop3.DownloadEntireMessage(pop3.InboxMessageCount);
                      msg.Parser.HeadersAsHtml = true;
                      msg.Parser.PlainToHtmlMode = PlainToHtmlAutoConvert.IfNoHtml;
                      msg.Parser.PlainToHtmlOptions = PlainToHtmlConvertOptions.UriToLink;
                      string from = msg.From.ToString();
                      string subject = msg.Subject.ToString();
                      string body = msg.BodyHtmlText;
                      SendEmailToSimply(from,subject, body);

public void SendEmailToSimply(string from, string subject, string body)
    {
        System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient();
        System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
        try
        {
             System.Net.Mail.MailAddress address = new System.Net.Mail.MailAddress(from);
             smtpClient.Host = "212.78.85.110";
             smtpClient.Port = 25;
             message.From = address;
             //message.To.Add("Processedorder@simply.co.uk");
             message.To.Add("sandyarani81@gmail.com");
             message.Subject = subject;
             message.IsBodyHtml = true;
             message.Body = body;
             smtpClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
             smtpClient.Send(message);
             Label1.Text = "Message has been sent";
        }
        catch (System.Net.Mail.SmtpException ex)
        {
             if (ex.StatusCode == System.Net.Mail.SmtpStatusCode.InsufficientStorage)
             {
                smtpClient.Send(message);
             }
             else
             {
                Label1.Text = "Send Email failed:" + ex.ToString();
             }
        }

    }
Whan i run this i am getting the message like message has been sent.but after 10 min i will see in my mail.mail did not come.all our settings are fine.i need to send a mail after reading a mail from the pop3 server which contains same body and same content.Could you please help me this.i am familiar with smtp so i used smtp instead of MailBee.
Back to Top View sandya's Profile Search for other posts by sandya
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 19 March 2008 at 5:05am | IP Logged Quote sandya

oops sorry,i could send mail.messages are going to spam in my google account.So i thought that i could not get.just now i checked.
Back to Top View sandya's Profile Search for other posts by sandya
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 19 March 2008 at 6:27am | IP Logged Quote sandya

AS far i am using MailBee trial version.I want to purchase it.i want to install on my server as well as on my local system.on my server we donot use internet explorer.What do i do.If i give licenskey on server,is it work after perchase.After perchase what i will get another license key or the same one which i am using.Could you please tell me?
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 19 March 2008 at 7:03am | IP Logged Quote Andrew

Now, you're using a trial license key which will expire. After purchase, you'll get a permanent key which will never expire. You should just replace your trial key with the permanent one on your server as well as on your local system.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sandya
Newbie
Newbie
Avatar

Joined: 12 March 2008
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 20 March 2008 at 4:51am | IP Logged Quote sandya

Hi,When i try to send a email from my server i am getting error like this.System.net.Mail.SmtpException.Insussicient System Storage.The server response was 4.3.1 out of memory.The code is above for sending email.Could you please tell me why its happening.
Back to Top View sandya's Profile Search for other posts by sandya
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 20 March 2008 at 5:19am | IP Logged Quote Andrew

"The server response was 4.3.1 out of memory" means exactly what it says, i.e. the SMTP server reports out of memory. Perhaps, this solution would help, if not, try to search other solutions in Internet.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide