你的意思是:
mailItem.HTMLBody = "<html><body><p>Dear IT Dept.</p> <p>You have received a new task to complete from " + textBox2.Text + " Please check the attached file and fit the task in to your schedule.</p><p> Once completed please contact the provided contactee for comfirmation the task is completed to thier expectations.</p>";
?
在您的版本中,「textbox2.txt」將作爲字符串操作,不會被「解析」。 在我的這是一個控制你的表格,我們把它的文本內容在郵件中。
編輯:你問到如何emphase變量,這裏是一個例子: 試着這麼做
mailItem.HTMLBody = "<html><body><p>Dear IT Dept.</p> <p>You have received a new task to complete from <strong>" + textBox2.Text + "</strong> Please check the attached file and fit the task in to your schedule.</p><p> Once completed please contact the provided contactee for comfirmation the task is completed to thier expectations.</p>";
在你的變量的「強勢」標籤將會把名稱加粗。
謝謝!添加多個我會增加數字,所以{0}將{1},然後在第一個尾部後面定義第二個字符串? – 2014-09-22 08:46:05
是的。有關詳細信息,請查看此頁http://www.dotnetperls.com/string-format。順便說一下,不要忘記讓我快樂與標記爲接受答案我的回答:) – 2014-09-22 08:53:46