 |
|
 |
Hi Kamraan,
I am trying to run your sample project. I got the error "Unhandle Timeout Exception". Do I need to register for ur project?
Thanks.
|
|
|
|
 |
|
 |
Can it work with unmanaged code, such as com/activex in vb?
thank you
|
|
|
|
 |
|
 |
How to get body part of the Message if it is Multipart ?
Please Reply........
|
|
|
|
 |
|
 |
Could you please tell me How i Get Bounced mails from my POP3.?
Deepesh jain..
(SoftWare Engineer)
REDTRAY INTERACTIVE SOLUTIONS Pvt. Ltd.
deepeshjain241718@yahoo.co.in
www.redtray.co.uk
|
|
|
|
 |
|
 |
hi,
i would like to know if it is possible to set a email id where i get all my bounced mails and reply to address to a another email id. Please let me know if it is with this component.
Regards,
Kiran
|
|
|
|
 |
|
 |
hi sir,
plz help to run .net mail component project what is the way to run.
emmanuel
|
|
|
|
 |
|
 |
Hey there is a bug in the download.
If you download the source files open the folder Mime and open Attachment.cs there you will see a method SaveAs that only creates a file.
You should insert the following just in front of the file.Close();
Base64Encoder decoder = new Base64Encoder();
byte[] data = decoder.Decode(this._part.BodyData);
file.Write(data, 0, data.Length);
Now I can save attachments.
regards
Bjorn Monnens
|
|
|
|
 |
|
 |
Hi,
When I try to use the DLL I got this error:
An instance of type 'cpSphere.Mail.Pop.Pop3' was being created, and a valid license could not be granted for the type 'cpSphere.Mail.Pop.Pop3'. Please, contact the manufacturer of the component for more information.
Please help
|
|
|
|
 |
|
 |
fragment on ContentTypeHeader class
public ContentTypeHeader(MimeMediaType mediaType, string subType, StringDictionary parameters) : base("Content-Type")
{
_mediaType = mediaType.ToString();
_subType = subType;
Parameters = Parameters ; //!!!!!!!!!!!
}
Property assign to property
|
|
|
|
 |
|
 |
What about serialization?
In Header class that you deleloped use the StringDictionary class that not supported serialization and object of Message class could not be serialized.
I try to replace StringDicrionary to Hashtable.
Classes Attachment and AttachmentCollection not marked [Serializable]!
|
|
|
|
 |
|
 |
I replace StringDicrionary to Hashtable and marked some classes serializable. It's work
|
|
|
|
 |
|
 |
Hi Kamraan:
It is a very good email component. Does it sopport iCalendar? ie. Content-Type:text/calendar; method=request;
What I like to do is email calendar evant to receivers, when user open it, it look like outlook calendar event email. Did you have this experience?
Thanks you help in advance.
Michael
|
|
|
|
 |
|
 |
1 -- It was necessary to remove various odd license things from the source before attempting to use it. Is the code being released to benefit the user, or to make the author feel important?
2 -- It is unstable. For example, connecting twice is a certain uncaught exception for the following two reasons: _isConnected does not get set to false when a connection is closed, and the socket (hidden in it's layers of wrapper classes) gets disposed when the connection is closed, and then never re-initialized. Presumably connecting more than once was never tested.
3 -- It is extremely unstable! Look at the messagesCache field. When is anything removed from it? That's right -- it grows indefinitely. Better still, in Pop3.Login, if messagesCache.Count is bigger than msgSize.Count, the login fails because you compare the index into msgSize with the length of messagesCache! This is a deal-breaking bug (one of many) and it's there because you were busy feeling clever and didn't keep track of what your various collections mean.
4 -- It does weird things. For instance, GetMessages() throws an exception when there are 0 messages on the server. Returning a list of messages of length 0 would have been much better. Actually, there is a general sense of 'zero length collections are an error' throughout the code, and a general use of exceptions to indicate things that are not errors.
5 -- It does not actually implement POP3 correctly or completely. For instance, look at the assumption the DeleteAll method makes about message numbers. A correctly-behaving POP server will return 'Protocol Error' when faced with that.
6 -- It is vastly overengineered. A good example of this is the pseudo-state machine structure. POP3 is a request/response protocol with very little state -- the fact that your 'state machine' has only three states and one of them does not actually do anything should suggest to you that something is wrong!
7 -- It is really vastly overengineered! Pretty much every class cries out to be held up as an example here. A simple socket connect is a 38-line function in a special custom TcpSocket class from which PopTcpSocket is then inherited.
8 -- Minor points: There are bitmaps included with the POP and SMTP classes. Better to keep some separation going between interface and logic. The code layout is a bit odd -- ending a line with 'new' is a new one for me.
I'm sorry to be crabby, but there are very severe issues with this library and they are issues that would not be there if the author had spent less time thinking of himself as a software architect and more time actually implementing the protocol in question. To fix the code, I would try to:
1 -- Reduce it to about 2/3 the current length, in total.
2 -- Get rid of the socket wrappers, 'state machine', etc.
3 -- Get rid of, or comment, the black magic -- e.g. that strange byte array full of odd numbers in the Recieve() method.
4 -- WRITE UNIT TESTS!! And use them! This is very important.
5 -- Make it nice to use -- for instance, make message parts available as strings or byte[]s as well as streams.
Once again, I'm sorry to be arrogant, critical, supercilious, and bad-tempered -- but for various reasons I have had to spend a great deal of time making this code work, and it has not been a simple or pleasant task!
You'd also better fix the various places where it says Kamran M. Qamar, the guru behind this compoenet. Unfortunately, those words are very revealing.
URL: http://www.jbrowse.com
Favorite Toy: http://www.ruby-lang.org
|
|
|
|
 |
|
 |
I'm not going to be as harsh as old Ben here, but I have found that the component does not parse things correctly. At first I just thought it was a problem with the comment parser. If there is any comma's in an email address comment - \"Name,Your (dude,whatever)\" <email@server.com> - it throws an exception. I have since found it does not parse other pieces correctly either. For instance, the message.Body function throws an excpetion on some emails becuase it did not parse it correctly and puts the body text in the wrong List element and cannot retrieve it again. I would NOT recommend this for anything other than a general overview of what one could do when creating an email client and I think Ben would have something to say about that too.
|
|
|
|
 |
|
|
 |
|
 |
The supplied source code that compiles -> cpSphere.Mail.dll is only a header file with references to \bin\debug\cpSphereCertificate.dll that is compiled and not viewable. There may be a time limit on using the dll and other demo restrictions.
|
|
|
|
 |
|
 |
There's a version without the license at the external link the article has posted.
Thanks for the cool components.
rfv
|
|
|
|
 |
|
 |
I'm executing the following code:
..
msg = pop31.GetMessage(1);
msg.Attachments[0].Save("c:\\dir");
and the downloaded archive is empty.
some idea?
|
|
|
|
 |
|
 |
I have the same problem, the saved files are 0KB!
Can someone please help me? Thanks for your help
And where can I get the licence?
msg.Attachments[j].SaveAs(@"C:\Temp\", msg.Attachments[j].FileName);
|
|
|
|
 |
|
|
 |
|
 |
Hi Kamraan,
i really have to thank you!!!!
if you're planning to come in Italy, please let me know .
Fabio
|
|
|
|
 |
|
 |
I think you'd better open your source code.
I hope you can understand my english.
|
|
|
|
 |
|
 |
The link here is to a an msi that installs source code for a DEMO of a mail protocol. Maybe this is just a mistake, but it feels like a plug for a product.
|
|
|
|
 |
|
 |
Hi Kamraan,
well where is the source code? i downloaded the zip file attached to the article and it had 2 files MSI and txt. I installed the MSI and it didn't have the source code. where can i get it from?
thanks
|
|
|
|
 |
|
 |
Hi,
Could anyone give me a reference to some samlecode/documentation about handling Mime Content in C#. I have the required functionality present in Java but I need to transform the code to C#. Below I attact the code that I have. There are a couple of classes in Dot Net Framework but I am unable to find a good example and short of time. Thanks in Advance.
Regards,
Rehman Adil
public class MMSMessageContent extends MimeMultipart
{
public MMSMessageContent()
{}
/**
* Adds a part (String) to the message content.
* It is expected to be us-ascii text.
* @param aTextPart The String to be added.
*/
public void addTextMedia(String aTextPart)
{
try
{
MimeBodyPart mbp = new MimeBodyPart();
mbp.setText(aTextPart, "us-ascii");
mbp.addHeader("Content-Type", mbp.getContentType());
addBodyPart(mbp);
}
catch (MessagingException e)
{
throw new RuntimeException(e.getMessage());
}
}
/**
* Adds a part (mediaobject) to the message content.
* @param aFilename A filename refering to a file of which a
* MimeBodyPart is created and added to the MMSContent
*/
public void addMedia(String aFilename)
{
try
{
FileDataSource fds = new FileDataSource(aFilename);
MimetypesFileTypeMap map = new MimetypesFileTypeMap();
MimeBodyPart mbp = new MimeBodyPart();
mbp.setDataHandler(new DataHandler(fds));
mbp.setHeader("Content-Type",
map.getContentType(aFilename));
mbp.setHeader("Content-Transfer-Encoding", "base64");
// mbp.setContentID("CONT" + getCount());
addBodyPart(mbp);
}
catch (MessagingException e)
{
throw new RuntimeException(e.getMessage());
}
}
/**
* Adds a Byte Array bodypart
* @param aByteBodyPart the Byte bodypart that has to be added
* @param aContentType the content type of the bodypart
*/
public void addByteArrayBodyPart(byte[] aByteBodyPart, String aContentType)
{
try
{
ByteArrayInputStream bis = new ByteArrayInputStream(aByteBodyPart);
MimeBodyPart mbp = new MimeBodyPart(bis);
mbp.setHeader("Content-Type", aContentType);
// mbp.setContentID("CONT" + getCount());
addBodyPart(mbp);
}
catch (MessagingException e)
{
throw new RuntimeException(e.getMessage());
}
}
/**
* @return A byte array of the complete(including the content-type of the
* whole MMSMessage Content) content.
*/
public byte[] getBinaryContent()
{
try
{
ByteArrayOutputStream byteArrayBuffer = new ByteArrayOutputStream();
// The content type of the whole content is requested and added to the output
String contentType = "Content-Type: "
+ this.getContentType() + "\r\n\r\n";
byteArrayBuffer.write(contentType.getBytes());
byteArrayBuffer.flush();
writeTo(byteArrayBuffer);
return byteArrayBuffer.toByteArray();
}
catch (IOException e)
{
throw new RuntimeException(e.getMessage());
}
catch (MessagingException e)
{
throw new RuntimeException(e.getMessage());
}
}
}
|
|
|
|
 |