我创建了一个事件接收器,以在添加项目时触发电子邮件。在此事件中,接收器电子邮件将发送给员工。在电子邮件内容中,我想提供一个链接,以便员工可以直接访问该网站。但在我的代码中我遇到了一些问题。这是我的代码
public string MailMsgBody_WU(string MailTo, SPItemEventProperties IERProperties)
{
string MMsgBody = "";
System.Diagnostics.Debug.WriteLine("Travel Request-MailMsgBody(): Begin");
try
{
MMsgBody += "<table>";
MMsgBody += "<tr><td>Hi,</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td> New Calendar Item Event" + IERProperties.ListTitle + " has been added into learning portal.</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td>Please click on the following link to view the details.</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td><a href=" + http://tri02sharepoint:47709/Lists/Learning%20Calendar/calendar.aspx + ">Click Here</a></td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td>Thanks,</td></tr>";
MMsgBody += "<tr><td>Learning Team</td></tr>";
MMsgBody += "</table>";
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("Travel Request-MailMsgBody(): End" + ex.Message.ToString());
}
return MMsgBody;
}
我得到了错误
MMsgBody += "<tr><td><a href=" + http://tri02sharepoint:47709/Lists/Learning%20Calendar/calendar.aspx + ">Click Here</a></td></tr>";
http:// <---- 这里是错误
这些是错误
错误 1 无效的表达式术语 ':'
错误 2 ; 预期
错误 3;预期的