473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Formatting Received POP Emails

Hi There
I have been searching high and low on the internet for a solution to my problem but so far have failed to find one. I am trying to embed a pop3 mail reader into the administrative interface of my website so any admin user that has logged in can read their emails.

So far I have managed to get it to connect, read and list the messages on the server but when it actually comes down to displaying the message i get the following output as a message body...

Expand|Select|Wrap|Line Numbers
  1. From: "Derry O'Neill" <user@example.com> 
  2. Subject: Welcome To Everything X-Box! 
  3.  
  4. This is a multi-part message in MIME format.
  5.  
  6. ------=_NextPart_000_0004_01C81BD3.F09EFDA0
  7. Content-Type: text/plain;
  8. charset="iso-8859-1"
  9. Content-Transfer-Encoding: quoted-printable
  10.  
  11. Hey There!
  12. As I understrand it you have been recruited to the everything x-box team =
  13. by our very own EXB DJ Danny. I have set you up with an EXB email =
  14. address and will be adding you to our staff database as soon as I can. =
  15. You can view the current progress of the EXB website development project =
  16. at http://www.example.com=20
  17.  
  18. Eventually you will be required to add input to the site via the =
  19. administrative interface. This is a simple enough task but you will =
  20. require an administrative login to do so. Your admin login will be sent =
  21. to you via email as soon as it becomes available. Please be aware that =
  22. there may be a delay as I haven't quite got around to creating the admin =
  23. area as yet!
  24.  
  25. May I be the first to welcome you onto the team and I hope you stay with =
  26. us throughout our web-based lifetime.
  27.  
  28. Regards,
  29. Derry O'Neill
  30. ------=_NextPart_000_0004_01C81BD3.F09EFDA0
  31. Content-Type: text/html;
  32. charset="iso-8859-1"
  33. Content-Transfer-Encoding: quoted-printable
  34.  
  35.  
  36.  
  37. charset=3Diso-8859-1">
  38.  
it then goes on to display the html version of the email.

Is there any way to do away with the additional headers and all the '=' signs to just leave the message text? if you need a real example of the out put check the site at;

http://81.104.192.121/exb/admin/email.php

It will auto log in with an example email address

Thanks In Advance,
SodiumBA
Oct 31 '07 #1
2 1100
Atli
5,058 Expert 4TB
Hi Sodium. Welcome to TSDN!

I've removed your email address from your post, as posting emails in the technical forums is not allowed. This is mainly to protect your email from being harvested by spammers.

I've also removed the links to the website in your example email, as links to almost anything expect test servers, especially webs that contain advertisements or other content that may violate the Posting Guidelines , are forbidden in the technical forums.

As to your problem.
You need to strip away those parts of the message you do not want to show. Emails like those you posted above are always formatted to some standard, so they shouldn't be very hard to parse into whatever you need.

Check out the String Function section at php.net for a list of functions that can be used for this.

If you run into any trouble, post again and we'll do our best to help you out.
Oct 31 '07 #2
Thank you for you quick reply.

First of all apologies for posting those links, it was just a cut and paste jobby and I was unaware that they were quoted.

I have browsed through the different functions but am yet to find anything that will actually work. It must be possible otherwise squirrelmail and horde would be full of unsightly headers. I am at a loss and i'm thinking about maybe just implementing one of the above mentioned mail clients to save the headache hehe...

although it would be better if i could get this to work so my mail client fits in with the site skin flawlessly.... :)
Nov 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Robert | last post by:
I need some help with formatting some text received from a database query. I am only selecting a single row per query so the formatting will only be performed on a single row. The rows I need to...
0
by: Benjamin Han | last post by:
A while ago I asked if anyone knows a module for parsing Received: headers in emails. Apparently my guess was wrong (that someone already wrote it in Python). I got an email pointing me to...
0
by: dont bother | last post by:
Hi, I am a new bie experimenting with python. I have this piece of code to parse the received headers from emails. However, when I run with a file as an argument it skips lines like: 1, 3, 5...
5
by: Tom Petersen | last post by:
I have this: 1 emailBody = "<html>" & vbCrLf _ 2 & "<head>" & vbCrLf _ 3 & "<title>Interpreter Request details</title> " & vbCrLf _ 4 ...
5
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
2
by: David | last post by:
I have an application that stores the time information received via the serial port from some hardware. The application needs to compare this time gainst the time received in the last packet and...
11
by: ibiza | last post by:
Hi all, I am trying to use the System.Net.Mail class for the first time, with ASP.NET 2.0. I setup everything according to http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives...
1
by: AJG | last post by:
Hi there. I am using a library called SOCI that has a method to set a stream which it uses to log SQL queries. The signature is as follows: void setLogStream(std::ostream *s); This works great...
1
by: poopsy | last post by:
hello I have been trying to send email to a group of users found in my database, but the problem is the email is being sent but not received. I have also tried sending only to one recipient, it does...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.