Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi idhttp post problem (https://www.delphipraxis.net/98512-idhttp-post-problem.html)

agm65 28. Aug 2007 13:35


idhttp post problem
 
hi leute ..ich dreh hier gleich ab ich möchte per http post eine email über eine php verschicken:

Delphi-Quellcode:
<?
 mail($_POST['email'], $_POST['subject'], $_POST['message'], "from: " . $_POST['sender']);
?>


var
  ParamData : TStringStream;
begin
  Sendhttp.HandleRedirects:=true;
  ParamData := TStringStream.Create('');
  ParamData.WriteString('email=' + sendMailAddy );
  ParamData.WriteString('subject=' + txtsubject.Text);
  ParamData.WriteString('message=' + txtmessage.text);
  ParamData.WriteString('sender=absender@fmhg.de');
  try
   txtmessage.text := SendHTTP.Post('http://atmail.php', ParamData);
   statusbar.Panels[0].Text := 'Status: eMail gesendet..';
  finally
  ParamData.Free;
  end;
es kommt einfach nichts an ..aber ich bekomme auch keinen fehler und wenn ich in der php get statt post mache und die im browser aufrufe, geht alles !

mkinzler 28. Aug 2007 14:20

Re: idhttp post problem
 
Was kommt den im Skript an?

agm65 28. Aug 2007 15:23

Re: idhttp post problem
 
wie kann ich mir das ausgeben lassen ?

inherited 28. Aug 2007 15:47

Re: idhttp post problem
 
echo($_POST['email']) ?

agm65 28. Aug 2007 15:52

Re: idhttp post problem
 
ja, das dachte ich auch und dann müsste ich ja in message.text was zurück bekommen aber da steht nichts..muss hinter das .php noch ein '?' ? nein geht auch nicht..

inherited 28. Aug 2007 16:23

Re: idhttp post problem
 
Und wenn du statt einem StringStream den Indy-eigenen TIdMultiPartFormData(oder so ähnlich) Stream nimmst?

agm65 29. Aug 2007 07:50

Re: idhttp post problem
 
glaube nicht das es daran liegt ... vll lieg es am proxy ...ich werde nochmal weiter suchen

Phistev 29. Aug 2007 08:27

Re: idhttp post problem
 
Müssen die einzelnen Parameter evtl. durch #13#10 oder & getrennt werden? (hab gerade keine Möglichkeit, das festzustellen)

/edit: Wofür gibt's Wireshark
Code:
Content-Type: multipart/form-data; boundary=---------------------------6430211613648
Content-Length: 1735

-----------------------------6430211613648
Content-Disposition: form-data; name="subject"

Re: idhttp post problem
-----------------------------6430211613648
Content-Disposition: form-data; name="helpbox"

URL einf.gen: [URL]http://url[/URL] or [URL=http://url]URL text[/URL]
-----------------------------6430211613648
Content-Disposition: form-data; name="message"

M.ssen die einzelnen Parameter evtl. durch #13#10 oder & getrennt werden? (hab gerade keine M.glichkeit, das festzustellen)
-----------------------------6430211613648
Content-Disposition: form-data; name="attach_sig"

on
-----------------------------6430211613648
Content-Disposition: form-data; name="notify"

on
-----------------------------6430211613648
Content-Disposition: form-data; name="add_attachment_body"

0
-----------------------------6430211613648
Content-Disposition: form-data; name="posted_attachments_body"

0
-----------------------------6430211613648
Content-Disposition: form-data; name="fileupload"; filename=""
Content-Type: application/octet-stream


-----------------------------6430211613648
Content-Disposition: form-data; name="filecomment"


-----------------------------6430211613648
Content-Disposition: form-data; name="mode"

reply
-----------------------------6430211613648
Content-Disposition: form-data; name="t"

117276
-----------------------------6430211613648
Content-Disposition: form-data; name="sets"

1188372289
-----------------------------6430211613648
Content-Disposition: form-data; name="last_newpost_reminder_time"

0
-----------------------------6430211613648
Content-Disposition: form-data; name="post"

Absenden
-----------------------------6430211613648--

inherited 29. Aug 2007 11:07

Re: idhttp post problem
 
Zitat:

Zitat von agm65
glaube nicht das es daran liegt ... vll lieg es am proxy ...ich werde nochmal weiter suchen

Da kennst du Indy aber schlecht. Ich hatte durchaus schon ähnliche Probleme. probier es doch mal aus, mehr als eine Exception kann schon nicht passieren ;)

agm65 5. Sep 2007 13:38

Re: idhttp post problem
 
Zitat:

Zitat von agm65
glaube nicht das es daran liegt ... vll lieg es am proxy ...ich werde nochmal weiter suchen

Zitat:

Zitat von inherited
Da kennst du Indy aber schlecht. Ich hatte durchaus schon ähnliche Probleme. probier es doch mal aus, mehr als eine Exception kann schon nicht passieren ;)


wollte hierzu nur nochmal kurz sagen ...ja stimmt ...es geht:

Delphi-Quellcode:
Uses IdMultipartFormData;


var
  data: TIdMultiPartFormDataStream;
begin
  data := TIdMultiPartFormDataStream.Create;

  data.AddFormField('email',  sendMailAddy);
  data.AddFormField('subject', txtsubject.Text);
  data.AddFormField('message', txtmessage.text);
  data.AddFormField('sender', 'support@fuck-ass.tv');
  try

   test.text := SendHTTP.POST('http://atmail.php' , data);


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:11 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz