I want to send a mail through console application and i want that ip address ,to address and from address
have to be stored into file and then i take them from file as these addresses can change.Kindly hepl
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vasanth R16 reputationPosted Sep 4, 2010, 8:28 PM EDT
Instead of using ReadToEnd() function, keep the From Address, To Address, etc... in each line and read the text file line by line
Thanks
vr
Mark it as Answer if it helps
Vasanth R16 reputationPosted Sep 4, 2010, 2:42 AM EDT
Neerav Sachdeva33 reputationPosted Sep 4, 2010, 6:51 PM EDT
Below is my code
string fromfile = @"D:\LogRotation\FromFile\FromFile.txt";
StreamReader fromtext = new StreamReader(fromfile);
string allfrom = fromtext.ReadToEnd();//here i received file data.
fromtext.Close();
//oMsg.From = "allfrom "; when i am using this i am not able to do that
oMsg.From = [email protected]; //only this works
Neerav Sachdeva33 reputationPosted Sep 4, 2010, 8:34 PM EDT
But i am not understand yours point ,actually i have to deploy a mail in my application but i want that from address, to address it takes from a file .can you help me by changing my existing code.