Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Formmailer

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Fri Nov 26, 2004 5:10 pm    Post subject: Formmailer Reply with quote

bin jetzt schon wieder am suchen und komem ncith weiter Question

Ich habe erst diesen Code in die index.php eingebunden...

Code:
<?php
require '../libs/Smarty.class.php';
$smarty = new Smarty;

$admin = "admin@123song(dot)de";
$subject = "123Song";

$message = "Nachricht fuer $admin von $email:\n\n";
while(list($name,$value)=each($HTTP_POST_VARS)) {
$message.="$name: $value\n\n";
}

mail($admin,$subject,$message,"From: $email");

$smarty->display('index.tpl');
?>


danach habe ich eine mail.php angelegt mit dem selben Code

in der index.tpl ist folgender Code
Code:
<form name="form2" id="form2" method="post" action="/demo/mail.php">
                <input type="submit" name="Submit3" value="Abschicken">
                <textarea name="Firmenname" id="Firmenname"></textarea>


aber es wird keine Mail abgesendet ?


Last edited by halloweb on Wed Jul 21, 2010 12:00 am; edited 1 time in total
Back to top
View user's profile Send private message
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Fri Nov 26, 2004 7:05 pm    Post subject: Reply with quote

...und wenn mir auch noch einer sagen k?nnte warum bei der mail.php oder ???.php die grafiken nicht dargestellt werden ?
Obwohl "$smarty->display('index.tpl');" mit eingebunden ist !

________
BMW M102


Last edited by halloweb on Wed Feb 02, 2011 7:04 pm; edited 2 times in total
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Fri Nov 26, 2004 7:15 pm    Post subject: Reply with quote

Guten Abend!

ad Grafiken:
gehts bei allen Seiten nicht?
Pfade von Grafiken müssen relativ zur PHP Datei sein, nicht relativ zur Template Datei (siehe Forumssuche, Manual)

ad Mail:
Wie wärs wenn du einfach mal schritt für Schritt das was dein PHP Script tut mit echo ausgibts?

probier mail(..) mal indem du die werte direkt reinschreibst.

achja, ich hoffe du hast alles emailadresse nicht "admin@123song(dot)de" sondern "admin@123song.de" eingetragen, sonst wirds ned funzen.

Unterstützt der Server den du benutzt überhaupt Mail? Wenns nur ein lokaler Server ist kanns ja leicht sein das gar nicht geht.

So far, mfg T.
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Fri Nov 26, 2004 8:34 pm    Post subject: Reply with quote

Guten Abend T.


Quote:
gehts bei allen Seiten nicht?


Bei 123song(dot)de/demo sind alle grafiken zu sehen !
Bei 123song(dot)de/demo/index.php sind die Grafiken nicht zu sehen Exclamation

Quote:
Grafiken m?ssen relativ zur PHP Datei sein


Die Grafiken sind relativ zur PHP Datei !

Quote:
PHP Script tut mit echo ausgibts


Mit echo l?sst sich alles ausgeben !

Quote:
probier mail(..) mal indem du die werte direkt reinschreibst

Dann bekomme ich diese Fehlermeldung ...

Code:
Parse error: parse error, unexpected '@' in /srv/www/htdocs/web78/html/demo/index.php on line 9


Quote:
emailadresse nicht "admin@123song(dot)de" sondern "admin@123song.de" eingetragen


Es ist
admin@123song.de eingetragen !

Quote:
Unterst?tzt der Server den du benutzt ?berhaupt Mail


Ja

Quote:
Wenns nur ein lokaler Server ist


Nein, es l?uft nicht auf dem Localen Server !

------------------------------------------------------------------------------------

Die "index.tpl" ?bermittelt die Daten an die "index.php" Datei ?

Code:
<form name="form2" id="form2" method="post" action="/index.php">


Die "index.php Datei soll die Daten weiter senden an die angegebene E-mail Adresse !

Code:
mail($admin,$subject,$message,"From: $email");


Code:
$admin = "admin@123song(dot)de";
$subject = "123Song-Mail";
$message = "Nachricht fuer $admin von $email:\n\n";


Code:

while(list($name,$value)=each($HTTP_POST_VARS))

{
$message.="$name: $value\n\n";
}


An was k?nnte es sonst noch liegen Question
________
Subaru Tribeca history


Last edited by halloweb on Wed Feb 02, 2011 7:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Fri Nov 26, 2004 9:01 pm    Post subject: Reply with quote

hab selber noch ned viel mit mail gearbeitet, aber das funkt bei mir:

$EMail = "Der User " . $POST['Username'] . " mit der E-Mail Adresse " . $POST['EMail'] . " hat sich registriert";

mail("t.dot@gmx.at","neuer TDT User",$EMail);

kannst ja mal probieren. aber änder die mailadresse Wink

das mit @ könnt ich mir nur vorstellen wenn du die anführungszeichen vergessen hast, wirst aber wohl noch nicht, denk ich mal.

also wenn du wieder auf die gleiche seite verweist von der du kommst, brauchst als action nur "" eintragen, reicht auch.

würd einfach mal mit der mail-funktion rumprobieren und nach dem fehler den du kriegst in google suchen.

mfg Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Fri Nov 26, 2004 9:42 pm    Post subject: Reply with quote

Dank T.,
der
Code:
$EMail = "Der User " . $POST['Username'] . " mit der E-Mail Adresse " . $POST['EMail'] . " hat sich registriert";

mail("t.dot@gmx.at","neuer TDT User",$EMail);



funktioniert einwandfrei Very Happy

________
Ford Verona

Last edited by halloweb on Wed Feb 02, 2011 7:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Sat Nov 27, 2004 11:30 am    Post subject: Reply with quote

Hallo Thomas,

kannst du mir sagen was in deiner Template Datei steht ?
Bei mir wird die E-mail versendet, aber ohne Inhalt Question

________
video reviews


Last edited by halloweb on Wed Feb 02, 2011 7:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Sat Nov 27, 2004 12:00 pm    Post subject: Reply with quote

... und jedes mal wenn die Startseite aufgerufen wird, bekomme ich einen neue Email zugesendet Question
________
AMC and transmissions


Last edited by halloweb on Wed Feb 02, 2011 7:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Sat Nov 27, 2004 1:07 pm    Post subject: Reply with quote

Was genau willst du denn per Email versenden, wie soll deine Seite aussehen?

Ich geh mal davon aus, dass du ein Formular mit mehreren Eingabefeldern hast und dieses auf Knopfdruck an deine Mailadresse senden willst, oder so ähnlich?

Wie meinst du wird ohne Inhalt versendet? Es wird halt kein Wert für $POST['Username'] und $POST['EMail'] vorhanden sein, wenns darum geht Wink

angenommen du hast n template das so ca wie folgt aussieht
<form name="post" type="post" id="post" ...>

Username: <input type="text" name="Username" value="Bitte Namen eingeben" /><br>
Mehl-Addi: <input type="text" name="Usermail" value="E-Mehl Adresse "/><br>
<input type="submit" name="absenden" value="Formular mailen" />

</form>


dann wirfst halt in php rein

if($_POST['absenden']!=NULL) //wenn absenden gedrückt
{
$EMail = "Der User " . $_POST['Username'] . " mit der E-Mail Adresse " . $_POST['Usermail'] . " hat sich registriert";

mail("bill.gates@microsoft.com","neues Spam Email",$EMail);
}

tada, fertig ist die Mailroutine Wink Wink Wink
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Sat Nov 27, 2004 2:17 pm    Post subject: Reply with quote

Super Very Happy Danke Very Happy

Es funktioniert, der eingegebene Text wird an die E-mail Adresse versendet !

Quote:
Es wird halt kein Wert f?r $POST['Username'] und $POST['EMail'] vorhanden sein


Das war der Grund ...

________
justin bieber

Last edited by halloweb on Wed Feb 02, 2011 7:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Sat Nov 27, 2004 10:27 pm    Post subject: Reply with quote

Quote:
Es funktioniert, der eingegebene Text wird an die E-mail Adresse versendet !


hoffentlich nicht an meine Wink

$POST gibts nämlich nur bei mir, sind die validierten $_POST Variablen, die vorher durch ne Funktion rennen Smile

mfg Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Sun Nov 28, 2004 11:19 am    Post subject: Reply with quote

Hallo Thomas,

Quote:
hoffentlich nicht an meine


Laughing

Quote:
$POST gibts n?mlich nur bei mir


Question

Hast du schon einmal versucht ein Script einzubinden, das dir erlaubt ein Attachment von deiner Seite aus zu versenden ?

________
Ford Country Sedan specifications

Last edited by halloweb on Wed Feb 02, 2011 7:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Sun Nov 28, 2004 6:21 pm    Post subject: Reply with quote

halloweb wrote:

Quote:
$POST gibts nämlich nur bei mir



wollte nur sagen, das du wahrscheinlich keie variable namens $POST hast... Smile

Nein, Attachments hab ich noch keine durchs Netz gejagt, aber frag mal google, der weiß immer was Wink

mfg Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP