![]() Static string emailToAddress = "RecieverID" //Receiver Email Address Static string emailFromAddress = "MYID" //Sender Email Address I also found different workaround using ASPNETMX, you can find Licence-key, Code example and Dll on that site class Program Return int.Parse(ResponseString.Substring(0, 3)) Public static int GetResponseCode(string ResponseString) Private static byte BytesFromString(string str) If (GetResponseCode(ResponseString) = 550)Ĭonsole.Write("Mai Address Does not Exist !") Ĭonsole.Write("Original Error from Smtp Server :" + ResponseString) ĭataBuffer = BytesFromString("QUITE" + CRLF) * Read Response of the RCPT TO Message to know from google if it exist or not */ĭataBuffer = BytesFromString("RCPT TO:" + CRLF) NetStream.Write(dataBuffer, 0, dataBuffer.Length) ĭataBuffer = BytesFromString("MAIL FROM:" + CRLF) * Perform HELO to SMTP Server and get Response */ĭataBuffer = BytesFromString("HELO Shreya" + CRLF) StreamReader reader = new StreamReader(netStream) NetworkStream netStream = tClient.GetStream() TcpClient tClient = new TcpClient("gmail-smtp-in.l.", 25) So i didn't found the answer for this particular scenario but found some different workarounds class Program Can someone please help me to explain how can I achieve this scenario. On output I am getting success even though the from email is wrong. Mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess ("Disposition-Notification-To", emailToAddress) Smtp.Credentials = new NetworkCredential(emailFromAddress, password) Using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber)) (new Attachment("D:\\TestFile.txt")) //-Uncomment this to send any attachment Mail.From = new MailAddress(emailFromAddress) ![]() Using (MailMessage mail = new MailMessage()) Static string body = "Hello, This is Email sending test using gmail." Static string emailToAddress = //Receiver Email Address Static string password = "password" //Sender Password Static string emailFromAddress = //Sender Email Address I want to get the delivery notification after sending a mail whether is was success or failure, on google I got to know about DeliveryNotificationOptions, but when i tried to create one poc to check this I am not getting proper answer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |