我似乎无法在SharePoint 2010中发送来自visual basic的电子邮件。我使用下面的代码生成和发送电子邮件,但它仅在发送到运行代码的服务器上托管的电子邮件时才有效。我想发送给任何电子邮件地址 - 我该怎么做?
'Test If Email Is Current
If SPUtility.IsEmailServerSet(workflowProperties.Web) = True Then
'Set Headers
Dim Headers As New System.Collections.Specialized.StringDictionary
Headers.Add("To", "administration@emailaddress.co.uk)
Headers.Add("From", "sender@emailaddress.co.uk")
Headers.Add("Subject", "Message Subject")
Headers.Add("content-type", "text/html")
'Send Email
Dim Emailsent As Boolean
Emailsent = SPUtility.SendEmail(workflowProperties.Web, Headers, "Message Body")
End If