Ça semble bien. J'ai juste cette ligne en plus :
IdSMTP->AuthenticationType = atLogin;
Je te file mon code en entier (qui fonctionne sans problème) :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| IdMessage->From->Text = "moi@xxx.com";
IdMessage->ReplyTo->EMailAddresses = "moi@xxx.com";
IdMessage->Recipients->EMailAddresses = "toi@xxx.com";
IdMessage->Subject = "Pour toi";
IdMessage->Body->Add("Bonjour toi");
IdSMTP->AuthenticationType = atLogin;
IdSMTP->Username = "moi@xxx.com";
IdSMTP->Password = "123456789";
IdSMTP->Host = "smtp.xxx.com";
IdSMTP->Port = 25;
try
{
IdSMTP->Connect(5000);
IdSMTP->Send(IdMessage);
IdSMTP->Disconnect();
}
catch(Exception &e)
{
ShowMessage(e.Message);
} |
Partager