Witam..
wiem, że mój problem najczęściej rozwiązywany jest w C# mnie jednak interesuje jak zrobić to w C++ korzystając z .Net. Napisałem prosty, krótki kod, kompiluje się bez problemu, jednak, gdy go odpalam to wyskakuje błąd:
An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll
Additional information: Failure sending mail.
Kod:
using namespace System;
using namespace System::Net::Mail;
int main(array<System::String ^> ^args)
{
MailMessage^ msg = gcnew MailMessage("[email protected]", "[email protected]",
"Witaj", "Jak sie masz?");
SmtpClient^ client = gcnew SmtpClient("127.0.0.1");
client->UseDefaultCredentials::set(true);
client->Send(msg);
delete msg;
delete client;
return 0;
}
wiem, że błąd Failure sendig email dotyczy linijki clinet->Send(msg). Ale dlaczego?