2014/8/12

System.ArgumentException: The specified string is not in the form required for a subject.(指定字串不在主旨的必要表單中)

當操作.Net 寄信時, 若信件主旨會隨 User KeyIn 資料而有所變動時,
以上狀況就有可能發生了.

發生原因為:
      信件主旨中含有 (\r) 或 (\n) 的狀況~~慘遭Mail Server 退信.

報錯:




解決辦法:
    置換 寄信當下的主旨內容

             this._mailsubject = subject.Replace("\r", "").Replace("\n", "");


沒有留言: