PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > mail if I insert a function not work more
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
mail if I insert a function not work more

Réponse
 
LinkBack Outils de la discussion
Vieux 16/06/2007, 17h44   #1
artev
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut mail if I insert a function not work more

function_x is a function;

if I write this:
print function_x('parameter_x') ;
at screen I have: infox@sito.com (one email)

but if I write so:

mail(function_x('parameter_x'),'a', 'b', 'c');
I have this error:
SMTP server response: 554 DATA Transaction failed, no recipients given

how I can insert the function's value inner mail?
  Réponse avec citation
Vieux 16/06/2007, 21h06   #2
peter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mail if I insert a function not work more

> function_x is a function;
>
> if I write this:
> print function_x('parameter_x') ;
> at screen I have: infox@sito.com (one email)
>
> but if I write so:
>
> mail(function_x('parameter_x'),'a', 'b', 'c');
> I have this error:
> SMTP server response: 554 DATA Transaction failed, no recipients given
>
> how I can insert the function's value inner mail?


Providing everything you have written is correct then it should work. 1 note
however ensure that where you have c that it contains a valid header, if you
do not want to send cuustom headers then omit this optional parameter.



  Réponse avec citation
Vieux 17/06/2007, 11h39   #3
artev
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mail if I insert a function not work more

Il Sat, 16 Jun 2007 21:06:21 +0100, peter ha scritto:

> mail(function_x('parameter_x'),'a', 'b', 'c');


so not work;


is necessary to have some similar at:
mail(print function_x('parameter_x'),'a', 'b', 'c');
  Réponse avec citation
Vieux 17/06/2007, 12h58   #4
Sebastiaan 'CrashandDie' Lauwers
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mail if I insert a function not work more

artev wrote:

> so not work;


It should work, maybe posting the whole function could be nice ? As
obviously the problem lays there...

> is necessary to have some similar at:
> mail(print function_x('parameter_x'),'a', 'b', 'c');


No not at all, print would show the information on screen (to the
client) and return a boolean (1) for return value...

From the PHP documentation:

<snippet>
Description
int print ( string $arg )

Outputs arg. Returns 1, always.
</snippet>

So if you use print, you'd be doing this:

mail (1, 'a', 'b', 'c');
// And the client would see the return value of function_x ();

HTH,

S.

  Réponse avec citation
Vieux 17/06/2007, 14h15   #5
Rik
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mail if I insert a function not work more

On Sat, 16 Jun 2007 18:44:40 +0200, artev <mailnotspammm@notspamm.nn>
wrote:

> function_x is a function;
>
> if I write this:
> print function_x('parameter_x') ;
> at screen I have: infox@sito.com (one email)


Are you looking at the HTML source, or the screen? I recall a few months
ago someone who actuually had something like '<b>mail@examle.com</b>'
instead of just the address....

> but if I write so:
>
> mail(function_x('parameter_x'),'a', 'b', 'c');
> I have this error:
> SMTP server response: 554 DATA Transaction failed, no recipients given
>
> how I can insert the function's value inner mail?


It should work, examine your string carefully.



--
Rik Wasmus
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 16h15.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10118 seconds with 13 queries