SirReadAlot
asked on
Operator '==' cannot be applied to operands of type 'void' and 'bool'
Hi experts,
just trying to turn this smtp.Send(msg); into a boolean condition
smtp.Send(msg);
if (smtp.Send(msg) ==false)===========this line errors
{
Console.WriteLine("UnSucce ssfull");
Console.ReadLine();
}
Console.WriteLine(" Successfull");
how do i proceed
just trying to turn this smtp.Send(msg); into a boolean condition
smtp.Send(msg);
if (smtp.Send(msg) ==false)===========this line errors
{
Console.WriteLine("UnSucce
Console.ReadLine();
}
Console.WriteLine(" Successfull");
how do i proceed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi angel,
i think i fixed the problem by using this smtp.SendAsync(mail, null);.
SendAsync==Sends the specified e-mail message to an SMTP server for delivery. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes.
however is it wrong to use null
thanks
i think i fixed the problem by using this smtp.SendAsync(mail, null);.
SendAsync==Sends the specified e-mail message to an SMTP server for delivery. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes.
however is it wrong to use null
thanks
ASKER
smtp has no other property to state if items is delivered or not. but i found this class SmtpFailedRecipientsExcept