 |
|
 |
Hello, I have written following code but even if mail has attached file the code doesnt recognize it.what change is needed in code?
Dim MA As Indy.Sockets.AttachmentFile
Dim mpp As MessagePart
For Each mpp In xMsg.MessageParts
If mpp.GetType.ToString = "Indy.Sockets.AttachmentFile" Then
'If TypeOf mpp.GetType Is Indy.Sockets.AttachmentFile Then
MA = mpp
If IsNothing(MA.FileName) Then
Else MsgBox("Got") MA.SaveToFile("C:/messages/attachments/" + MA.FileName.ToString)
STR = STR + "Attached File: " + MA.FileName.ToString + " "
End If
End If
Next
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I'am try to make a Inbox With Indy But I cant read the mail correctly; all the message appers like this
this is my code
string body = ""; Indy.Sockets.Text MP = (Indy.Sockets.Text)xMsg.MessageParts[0]; body = MP.Body.GetText(); string CadenaBody = ""; CadenaBody += body + "";
Indy.Sockets.AttachmentFile MailAttachement; foreach (MessagePart mpp in xMsg.MessageParts) { if (mpp.GetType().ToString() == "Indy.Sockets.AttachmentFile") { MailAttachement = (Indy.Sockets.AttachmentFile)mpp; if (MailAttachement.FileName != "") { MailAttachement.SaveToFile("C:/"); CadenaBody = CadenaBody + "Attached File: " + MailAttachement.FileName.ToString() + " "; }
} } CadenaBody = CadenaBody + "___________________FIN DE MENSAJE____________________" + " " + " ";
Response.Write(CadenaBody);
------=_NextPart_001_01DB_01C98073.CFEDEAC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable was checked by NOD32 antivirus system. http://www.eset.com ------=_NextPart_001_01DB_01C98073.CFEDEAC0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Enviamos una cordial que hoy cumple = a=F1os.
=A0=A0=A0=A0
=A0
__________ NOD32 3831 (20090205) Information __________
This message was checked by NOD32 antivirus system. http://www.eset.com ------=_NextPart_001_01DB_01C98073.CFEDEAC0-- ------=_NextPart_000_01DA_01C98073.CFEDEAC0 Content-Type: image/jpeg; name="image001.jpg" Content-Transfer-Encoding: base64 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BW/s2y/59Iv++aP7Nsv+fSL/vmr NFAFb+zbL/n0i/75o/s2y/59Iv8AvmrNFAFb+zbL/n0i/wC+aP7Nsv8An0i/75qzRQBW/s2y/wCf SL/vmj+zbL/n0i/75qzRQBW/s2y/59Iv++aP7Nsv+fSL/vmrNFAFb+zbL/n0i/75o/s2y/59Iv8A vmrNFAFb+zbL/n0i/wC+aP7Nsv8An0i/75qzRQBW/s2y/wCfSL/vmj+zbL/n0i/75qzRQBW/s2y/ 59Iv++aP7Nsv+fSL/vmrNFAFb+zbL/n0i/75o/s2y/59Iv8AvmrNFAFb+zbL/n0i/wC+aP7Nsv8A n0i/75qzRQBW/s2y/wCfSL/vmj+zbL/n0i/75qzRQBW/s2y/59Iv++aP7Nsv+fSL/vmrNFAFb+zb L/n0i/75o/s2y/59Iv8AvmrNFAFb+zbL/n0i/wC+aP7Nsv8An0i/75qzRQBW/s2y/wCfSL/vmj+z bL/n0i/75qzRQBW/s2y/59Iv++aP7Nsv+fSL/vmrNFAFb+zbL/n0i/75o/s2y/59Iv8AvmrNFAFb +zbL/n0i/wC+aP7Nsv8An0i/75qzRQBW/s2y/wCfSL/vmj+zbL/n0i/75qzRQBW/s2y/59Iv++aP 7Nsv+fSL/vmrNFAFb+zbL/n0i/75o/s2y/59Iv8AvmrNFAFb+zbL/n0i/wC+aP7Nsv8An0i/75qz RQBW/s2y/wCfSL/vmj+zbL/n0i/75qzRQBW/s2y/59Iv++aP7Nsv+fSL/vmrNFAHMNbQbj+6Xqe1 J9mg/wCeS/lUzfeb6mkrtsjnucJ4qmlhik8qWSPE+BtcjjmuW+3Xn/P3cf8Af1v8a6bxf/qpf+vj /GuSrrwiTp/M5cS3
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Works great on my development machine. When I try it on my web server, I get "Unable to log on" with the POP3 Connect statement. Anyone else seeing this? Thanks...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
There are several forms of auth. Its possible your server does not accept basic auth. You need to find out what type it supports and configure the client to use it.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
"NO Connection Could Be Made Because the Target Machine Actively Refused It"
the above error occurs in the line xPOP3.Connect(xHost);
i am connecting to my local PC itself.and in the place of username in which format it must be given it is like username@abcd.com or username? can any one help?
Bye Regards
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi! Could you explain me how to decode emails in MIME format? The "Text" property takes only "This is a multi-part message in MIME format." Thanks!
|
| Sign In·View Thread·PermaLink | 1.33/5 |
|
|
|
 |
|
 |
I'm trying to figure out how to use at the same time Indy.Sockets and System.Windows.Form . In both librarys are classes 'Message' what make's an ambiguous reference. Somebody knows what to do about it?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Suppose if i want to use the POP3 in localhost means where i have to create the user account and password
|
| Sign In·View Thread·PermaLink | 3.33/5 |
|
|
|
 |
|
 |
Can you give me a sample of the actual Indy.Sockets release. I tried to convert the above sample. It runs but it always results in "No messages on account". But there are messages on server.
Thank you very much!
using System; using Indy.Sockets.Core; using Indy.Sockets.Mail;
namespace POP3SnippetsCSharp { class Class1 {
[STAThread] static void Main(string[] args) { try { string xHost = "1.1.1.1"; string xUsername = "***"; string xPassword = "***";
POP3 xPOP3 = new POP3(); xPOP3.Username = xUsername; xPOP3.Password = xPassword; xPOP3.Host = xHost; xPOP3.Connect(); xPOP3.Login(); int xCount = xPOP3.GetMessageCount(); if (xCount == 0) { Console.WriteLine("No messages on account."); } else { Message xMsg = new Message(); xPOP3.RetrieveRaw(1); Console.WriteLine("Subject: " + xMsg.Subject); Console.WriteLine("From: " + xMsg.FromAddress.ToString()); Console.WriteLine("To: " + xMsg.ToAddress.ToString()); Console.WriteLine(); Console.WriteLine(xMsg.Body.ToString()); } xPOP3.Disconnect(); } catch (Exception e) { Console.WriteLine(e.Message); } Console.WriteLine(""); Console.WriteLine("Press enter"); Console.ReadLine(); }
} }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi, I tried the example that you showed and it connects, shows the subject, from and to but the body it doesnt show. I look at the ContentType of the Message and it is multipart/mixed How can I read the body from this kind of message?
Btw, very nice library!!
Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
There is a C# port under way. But to answer your question, cycle through the colleciton of the MessageParts, you will find items in there. Either HTML / Richtext, or maybe attachments, or possibly both.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
if (xMsg.MessageParts.Count == 0) { MESAJ = xMsg.Body.GetText(); } else { for (int x = 0; x <= xMsg.MessageParts.Count - 1; x++) { if (xMsg.MessageParts[x].ContentType == "text/html") { MESAJ = ((Indy.Sockets.Text)xMsg.MessageParts.get_Items(x)).Body.GetText(); } else if (xMsg.MessageParts[x].ContentType == "text/plain") { MESAJ = ((Indy.Sockets.Text)xMsg.MessageParts.get_Items(x)).Body.GetText(); } } }
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
Great Article. This made seetting up a simple web based email checker for our Portal a snap. My only issue with Indy thus far has been getting the Date back from the Message Object.
When I say myMessage.Date it returns a Double Object. The Indy Documentation shows that this should return it's own TIdDateTime (should this be DateTimeStamp?) Object. Anyway, No matter what I try I seem to be unable to convert this to a proper Date. At it's best I've been able to convert it to a date, 1 year, 1 month and 1 day ahead of the actual date by using the SetFromTDateTime method, but it seems like this is padding the default date of Jan, 1, 0001 to the value.
I'm using the latest stable listed on the Indy website 20051007 with VS2005 and C#.
Here's a quick code sample that shows how I'm pulling it all in: for (int i = 0; i < 5; i++){ myMsg = new Message(); myPop3.Retrieve(numOfMessages - i,myMsg); messageSubjects[i] = myMsg.Subject; messageFrom[i] = myMsg.From.Text; messageDate.SetFromTDateTime(myMsg.Date); //messageDate = new DateTimeStamp(myMsg); // This doesn't seem to work at all messageDates[i] = messageDate.GetDayOfWeekShortName() + " " + messageDate.GetMonthName() + " " + messageDate.GetDayOfMonth() +", " + messageDate.Year; //new DateTime((long)myMsg.Date).ToLongDateString(); }
thanks, Ed Smith
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
 |
For whoever might still need answer to this question , use the following statement to retrieve the date:
DateTime.FromOADate(messageDate.Date).ToString("yyyy/MM/dd HH:mm");
Cheers!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
 | SSL  AMGG | 0:13 7 Aug '06 |
|
 |
Hi,
Thank you for your article and example but I have a problem. Our Mail-Server (QMail) allows only SSL-Connections, all other connectinos are disabled. I need some hint or better some codes, please!
Thank you in advance.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
 | Re: SSL  Chad Z. Hower aka Kudzu | 0:45 8 Aug '06 |
|
 |
There is a class you can hook to it for SSL support. I forwarded your message to one of the people who specializes in this.
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
 | Re: SSL  Niladri Mahapatra | 21:43 9 Apr '07 |
|
|
 |
|
 |
Hi
I've the problem , that the first message ( no matter which mailaccount i take) is returned empty.
How may I solve this?
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
|
 |
|
 |
Hi
Sometimes the Body of Mails contains "This is a MIME Multiparty Message" I think that this only happens when I got an HTEML mail, so how may I get the real body content?
BTW have you planed to convert your sampels to .NET 2.0?
This would be really gread because this tool is really nice!
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
Please if any one can help:
I tried to sent email from the yahoo to an x@xx.com email and then i use the code to read the email form x@xx.com email
email received from hotmail was succeefuly read, while the one from yahoo was read but the Body.Text is empty.
thanks.
|
| Sign In·View Thread·PermaLink | 4.00/5 |
|
|
|
 |
|
 |
Hi I would like to retrieve only unread messages from the email account. Pls tell me how to do this.
|
| Sign In·View Thread·PermaLink | 2.20/5 |
|
|
|
 |
|
|
 |
|
|
 |