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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vasanth RPosted Sep 5, 2010, 12:28 AM
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
Neerav SachdevaPosted Sep 5, 2010, 12:34 AM
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.
Neerav SachdevaPosted Sep 4, 2010, 10:51 PM
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
Vasanth RPosted Sep 4, 2010, 6:42 AM