|
Quite a few people have asked if this demo supports pop3 over ssl, in its current state the answer to this question is no, so if you are trying to download of gmail or anything over port 995 (the normal secure pop3 port) its not going to work.
I've had a quick look around and found an open project at http://www.mentalis.org/soft/projects/ssocket/
Look like it should be possible to mod this demo (or create a new one) using this library to add ssl support. If anyone does it let me know and ill post a link here to it, or when i get round to it i'll have a go
|
|
|
|
|
When the content of email is not English but the Chinese, it prompt the following error:
A problem occured while decoding a base64 email.
Do you have any idea to fix this issue? Thanks in advanced.
Yueming Wu
|
|
|
|
|
Hi,
Its probably having trouble with the character set. If you forward me the email i will take a look
|
|
|
|
|
Thanks for your reply,
I checked it more after I asked that question. It does not the trouble with the character set. The error occuried when there is a picture embeded in the email. I believe you are finding the way to fix this now. If you still want me to send you that email, please let us know. The problem is that I can not find your email address.
Thanks again for your help.
Yueming Wu
|
|
|
|
|
forward me the email to luke@beakersoft.wanadoo.co.uk and ill have a look
|
|
|
|
|
Hi,
Have u fix the problem that occurs decoding base 64 email?
I got that error, when an email has attachment(s). And this is the error:
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters.
Anyway, can you let me know how to retrieve attachment(s) using that code.
Thank you.
|
|
|
|
|
Someone uses this with gmail?
|
|
|
|
|
|
hi,
i cant access pop.gmail.com ...
in this link, they say that the port is 995
http://mail.google.com/support/bin/answer.py?answer=13287[^]
i changed your program in line 24
to connect to port 995
TCP.Connect(strServer, 995)
and the application show me an error message...
POP3ERROR -
Unexpected response from mail server when connecting...
thanks
|
|
|
|
|
i think the data is probably coming back encrypted, and as it stands this demo wont deal with that (it would explain why your getting an unknown response). I have a look this week and try and confirm what is happening.
|
|
|
|
|
I've been using this super app for awhile, but I think it does not work with SSL. Can you confirm? Any other alternatives?
Thanks
|
|
|
|
|
|
As mentioned in a previous message, adding support for attachments is very difficult. Is anyone is willing to help me write/debug it we can give it a go, i dont have enough time to tackle this on my own at present
|
|
|
|
|
How do i get rid of this part:
This is a multi-part message in MIME format.
--_bff0947c-7186-4598-9d02-f9df9c7b0372_
Content-Type: text/plain;charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
since it makes retrieving the data out difficult.
Tinei Nyatsvimbo
|
|
|
|
|
Hi,
At what point are you seeing that string, is it at the start of the email body?
|
|
|
|
|
Hi Luke,
The text is coming out at the beginning of the message and there is also some at the end of the message. I noticed now that it is as a result of the message being send as HTML from public domains like gmail which seem to add on that text. My problem with that is my data contained in the email will have excess details that i don't want to import into the database. Can this be stripped out?
Cheers & Thanks,
Tinei
Tinei Nyatsvimbo
|
|
|
|
|
You will be able to strip it out, its just a case of working out where the string starts and ends. If you forward me a couple of example emails ill have a look to see what the rfc's say about it, and try and come up with something
|
|
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0004_01C8FEDD.61546ED0
Content-Type: text/plain;charset="us-ascii"
Content-Transfer-Encoding: 7bit
'KSN001', '0', '', '', 0 , 0 , '', '', '', '', 0 , 'BAG', #09/Aug/2008
17:02:43#, 'BAG', 'WYVERNE', '', False , 'KSN00102D', 1 , '0006', 'COPPER
CONCENTRATE', '', '2510006', 'KSN00102D', 1198.4 , , '', '', '', '', '', '',
'', '', '', '', ' 'KSN001', '0', '', '', 0 , 0 , '', '', '', '', 0 , 'BAG',
#09/Aug/2008 17:03:10#, 'BAG', 'WYVERNE', '', False , 'KSN00102C', 1 ,
'0007', 'COPPER CONCENTRATE', '', '2510007', 'KSN00102C', 1198.4 , , '', '',
'', '', '', '', '', '', '', '', ' 'KSN001', '0', '', '', 0 , 0 , '', '', '',
'', 0 , 'BAG', #09/Aug/2008 17:03:39#, 'BAG', 'WYVERNE', '', False ,
'KSN00102B', 1 , '0008', 'COPPER CONCENTRATE', '', '2510008', 'KSN00102B',
1198.4 , , '', '', '', '', '', '', '', '', '', '', ' 'KSN001', '0', '', '',
0 , 0 , '', '', '', '', 0 , 'BAG', #09/Aug/2008 17:03:58#, 'BAG', 'WYVERNE',
'', False , 'KSN00102A', 1 , '0009', 'COPPER CONCENTRATE', '', '2510009',
'KSN00102A', 1198.4 , , '', '', '', '', '', '', '', '', '', '', ' 'KSN001',
'0', '', '', 0 , 0 , '', '', '', '', 0 , 'BAG', #09/Aug/2008 17:04:17#,
'BAG', 'WYVERNE', '', False , 'KSN001029', 1 , '0010', 'COPPER CONCENTRATE',
'', '2510010', 'KSN001029', 1198.4 , , '', '', '', '', '', '', '', '', '',
'', ' 'KSN001', '0', '', '', 0 , 0 , '', '', '', '', 0 , 'BAG', #09/Aug/2008
17:06:10#, 'BAG', 'WYVERNE', '', False , 'KSN001028', 1 , '0011', 'COPPER
CONCENTRATE', '', '2510011', 'KSN001028', 1198.4 , , '', '', '', '', '', '',
'', '', '', '', ' 'KSN001', '0', '', '', 0 , 0 , '', '', '', '', 0 , 'BAG',
#09/Aug/2008 17:06:28#, 'BAG', 'WYVERNE', '', False , 'KSN001027', 1 ,
'0012', 'COPPER CONCENTRATE', '', '2510012', 'KSN001027', 1198.4 , , '', '',
'', '', '', '', '', '', '', '', ' 'KSN001', '0', '', '', 0 , 0 , '', '', '',
'', 0 , 'BAG', #09/Aug/2008 17:06:44#, 'BAG', 'WYVERNE', '', False ,
'KSN001026', 1 , '0013', 'COPPER CONCENTRATE', '', '2510013', 'KSN001026',
1198.4 , , '', '', '', '', '', '', '', '', '', '', ' 'KSN001', '0', '', '',
0 , 0 , '', '', '', '', 0 , 'BAG', #09/Aug/2008 17:07:06#, 'BAG', 'WYVERNE',
'', False , 'KSN001025', 1 , '0014', 'COPPER CONCENTRATE', '', '2510014',
'KSN001025', 1198.4 , , '', '', '', '', '', '', '', '', '', '', ' 'KSN001',
'0', '', '', 0 , 0 , '', '', '', '', 0 , 'BAG', #09/Aug/2008 17:07:26#,
'BAG', 'WYVERNE', '', False , 'KSN001024', 1 , '0015', 'COPPER CONCENTRATE',
'', '2510015', 'KSN001024', 1198.4 , , '', '', '', '', '', '', '', '', '',
'', '
------=_NextPart_000_0004_01C8FEDD.61546ED0
Content-Type: text/html;charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
xmlns =3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
charset=3Dus-ascii">
Tinei Nyatsvimbo
|
|
|
|
|
Hi Tinei,
Try replacing the ParseBody function with this one:
Public Function ParseBody() As String
'To get the body, everything after the first null line of the message is it (rfc822)
Dim strTmp As String
Dim intLenToStart, intLenToend As Integer
'set the temp var to the message body by getting everything after the null line
strTmp = m_MessageSource.Substring(m_MessageSource.IndexOf(vbCrLf + vbCrLf))
'get the encoding of the message out, that way we know if we have to run it through the base64 decode
'routine or not
If InStr(m_MessageSource, "Content-Transfer-Encoding: base64") Then
'call the decode routine
strTmp = DecodeBase64(strTmp)
End If
'try and extract the plain text out of the email body
intLenToStart = InStr(strTmp, "Content-Type: text/plain")
strTmp = strTmp.Substring(intLenToStart, Len(strTmp) - intLenToStart)
'now find the first two new lines, this should be where the text starts
intLenToStart = InStr(strTmp, Chr(13) & Chr(10) & Chr(13) & Chr(10))
strTmp = strTmp.Substring(intLenToStart, Len(strTmp) - intLenToStart)
'find the end of the string, should be indicated by two more line ends and -------=_ Miuns another 2 places to get rid of
'the trailing 0D 0A
intLenToend = InStr(strTmp, Chr(13) & Chr(10) & Chr(13) & Chr(10) & "------=_") - 2
strTmp = strTmp.Substring(3, intLenToend)
'Strip out the odd hex that apears at the start and the end
strTmp = Replace(strTmp, Chr(10) & Chr(9), "")
strTmp = Replace(strTmp, Chr(13), "")
ParseBody = Trim(strTmp)
End Function
I think it should do what you want, but i'm not sure if it will cope with emails that dont contain a html part.
Let me know how you get one
|
|
|
|
|
Will try it out and let you know.
Cheers,
Tinei
Tinei Nyatsvimbo
|
|
|
|
|
|
i decided to trim the message in the database. haven't had time to test your solution. will do so this week and let you know.
Thanks a lot
Tinei Nyatsvimbo
|
|
|
|
|
Hi Luke,
I know this is a very old thread but I just wanted to let you know that your solution is working wonderfully for me and the updated code for parsing the body is perfect.
Thankyou so much.
Hope all is well.
Cheers,
Fletch
|
|
|
|
|
i cannot retrieve the body of the message and also if i have an email from gmail received the to cannot be extracted as gmail uses to: with lowercase and outlook express uses To: with uppercase. if i convert them all to lower or upper it extracts the (to:from to:.plz help
|
|
|
|
|
hi,
What problem are you getting trying to extract the message body, are you getting any errors in the code or is it just not outputting anything?
As for the extracting of the too section of the mail, i dont think case matters (i've not got the code handy so i cant check) but i think it converts it to upper case somewhere in the code. The only reason i can think so that not working is the too is in a strange format or place, but I would'nt expect it.
Feel free to forward me an example email and ill have a look if you want
Cheers
Luke
|
|
|
|
|