Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Mail Access in Delphi

Status
Not open for further replies.

markjhthompson

Technical User
May 31, 2008
4
GB
hi
could anyone help me?
I’m trying to open a webmail page in delphi I have searched the net for any solutions but have had no luck.

I am basically trying to:

1 access my webmail (Bluebottle.com)

2 automatically login

3 navigate to my access list
(mail.bluebottle.com/webmail/app/bluebottle_allowed.php)

4 Extract my allowed senders emails

I would like to do this as bluebottle has no export function
for allowed or blocked senders.

I understand TWebBrowser can open web pages but its logging on automatically within the application I don’t understand?

any help / tips would be most welcome

Thanks for your time

Mark...
 
If you examine the source code for the home page ( you'll see that a form is submitted via the HTTP POST method to So, basically you need to send all the hidden and non-hidden inputs (i.e. the email [imapuser] and password [pass]) programmatically to the URL I mentioned, something like the following (but with all the required inputs supplied):
Code:
var
  PostDataStream : TStringStream;
  ParamData : TStringStream;
begin
  PostDataStream := TStringStream.Create('');
  ParamData := TStringStream.Create('');
  ParamData.WriteString('imapuser=' + Username);
  ParamData.WriteString('&pass=' + Password);
  try
    //Connect
    http1.Post('[URL unfurl="true"]http://mail.bluebottle.com/filter.php',[/URL] ParamData, PostDataStream);
    richEditHTML.Text := PostDataStream.DataString;
  finally
    ParamData.Free;
    PostDataStream.Free;
  end;
  // Parse the rich edit text here
end;
Note: The above code uses an Indy component called TIdHTTP.

See this previous post for an example:
thread102-627709


Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
What I forgot to mention is that you're second-guessing Bluebottle and a better way to go would be to contact Bluebottle and tell them what you are trying to achieve and seek their advice, because they would know exactly how the filter.php script works.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Thanks’ Stretchwickster

I will give that a try ,at least now I have a starting point.

I have already written some code to extract email address's
from the html source that has been saved as a file but being able
to extract it directly from a web page would be really handy.

again thank you for your time

Mark...


PS. If my questions seem a bit vague or silly I would Like to state that I’m not actually
A programmer but a Heating Engineer!...
 
It's possible that filter.php issues the 302 temporary redirect if it find a problem with the arguments passed to it e.g. it may check the referring URL and redirect any that don't match what it expects.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
referring URL" would that mean the start page
eg or mail.bluebottle.com ?

if so is it possible to trick it into thinking
that the refering url is correct?


thanks clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top