Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2102 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  fonction mail() avec serveur SMTP necessitant une authentification

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

fonction mail() avec serveur SMTP necessitant une authentification

n°1333796
belgarion
Emporté par le Nexus
Posté le 28-03-2006 à 16:25:12  profilanswer
 

j'ai un petit probleme avec la fonction mail
 
le serveur SMTP que je souhaite utiliser requiére une authentification.
et le probléme c'est que je ne sais pas ou cela se configure (a priori ni dans le php.ini ni dans la fonction mail)
 
le serveur apache est sous windows

mood
Publicité
Posté le 28-03-2006 à 16:25:12  profilanswer
 

n°1333800
jol30
Fils caché de Chuck Norris
Posté le 28-03-2006 à 16:30:51  profilanswer
 

Tourvé sur php.net, pas testé.

Citation :


<?
include("Mail.php" );
 
$recipients = "mail_to@domain.mail";
 
$headers["From"]    = "mail_from@domain.mail";
$headers["To"]      = "mail_to@domain.mail";
$headers["Subject"] = "Test message";
 
$body = "TEST MESSAGE!!!";
 
$params["host"] = "smtp.server";
$params["port"] = "25";
$params["auth"] = true;
$params["username"] = "user";
$params["password"] = "password";
 
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory("smtp", $params);
 
$mail_object->send($recipients, $headers, $body);
?>


Message édité par jol30 le 28-03-2006 à 16:32:12
n°1333805
Woutcha
Posté le 28-03-2006 à 16:35:06  profilanswer
 

Ca peut marcher... a condition d'avoir la librairie Mail de PEAR :  
 
http://pear.php.net/package/Mail

n°1333810
belgarion
Emporté par le Nexus
Posté le 28-03-2006 à 16:43:06  profilanswer
 

ca a l'air pas mal votre truc je vais tester
 
merci :jap:


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  fonction mail() avec serveur SMTP necessitant une authentification

 

Sujets relatifs
Contrôle adresse mailServeur : Achat vente securise
Envoi mail, depuis le Web, à une heure donnéefonction PHP images
Transfert de serveur Web à serveur WebGénération d'un mail avec pièce jointe en PHP
problème avec la fonction RangeScript VBS : envoi mail automatique avec smtp & pièces jointes
Pointeurs sur fonction membre, héritage, toussa 
Plus de sujets relatifs à : fonction mail() avec serveur SMTP necessitant une authentification


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)