none
Error in SharePoint Email - Alerts and Workflow RRS feed

  • Question

  • Hi,

    I just checked the webapplication out-going email in General Setting and all is fine. I also check the Configure Outbound SMTP server is also fine.

    Weird, when I try to use my monitoring powershell script where the sender is the one configured, it's working perfectly fine. Im receiving email.

    But when I try using the email notification via Alert and Workflow (SPD), it's not sending emails.

    Tried this script found on the net:

    $email = "SPAdmin@test.net"
    $subject = "Test subject"
    $body = "Test body"
     
    $site = New-Object Microsoft.SharePoint.SPSite "https://test"
    $web = $site.OpenWeb()
    [Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($web,0,0,$email,$subject,$body)

    I check on log it says:

    EventID 7946:

    Cannot complete this action.

    Please try again.

    I already tried restating SPTimer and IISreset /noforce but nothing chnaged.

    Your assistance is appreciated.

    Thanks,

    Fran


    Tuesday, October 15, 2019 4:43 AM

All replies

  • Hi

    I test your powershell in my farm.

    I can send email success.

    You should check out-going email setting or server firewall.

    You should allow smtp port in your server at first.


    Please remember to mark the replies as answers if they helped.
    Linyu - SharePoint Engineer
    QQ Group: 72637444

    Tuesday, October 15, 2019 5:12 AM
  • Hello,

    Outgoing email setting is:

    On server firewall - I can actually send email using powershell script. Not sure if this is the issue.

    $msg.Body = Get-Content "C:\Scripts\Regression\Output\ServerReport.html" | out-string
    $msg.isbodyhtml = $true
    $smtp = new-object Net.Mail.SmtpClient("smtp.ds.net")
    $msg.From = "Admin@ds.net"
    $smtp.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
    $smtp.Send($msg)
    $attachment.Dispose();
    $msg.Dispose();

    Do you know how can I validate the SMTP Port? currently ours is set to default (port 25)

    Thanks!

    Frances


    Tuesday, October 15, 2019 5:27 AM
  • Hi,

    What value is returned when you run the test script from your post?

    Please make sure you have enabled port 25 via Start > Windows Firewall with Advanced Security > Inbound Rules > New Rule... > Port > TCP and type 25 > Allow the connection.

    I suggest you check ULS logs when the site is trying to send alert email and see if there is any potential issue in SharePoint server.

    Please refer to the links below for detailed information.

    Which SMTP Port Should I Use? Understanding Ports 25, 465, & 587.

    SMTP does not work on port 587 in MailEnable.

    Here’s another post with similar issue for your reference.

    Workflow/Alerts not working - Outgoing Mail Settings are correct!

    https://social.technet.microsoft.com/Forums/en-US/97a88528-e87f-44ca-b06c-daf87318c2fa/workflowalerts-not-working-outgoing-mail-settings-are-correct?forum=SP2016

    Please note:
    Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, October 15, 2019 9:17 AM
  • Hi Chealsea,

    I telnet on port 25 on both WFE and APP servers and it all passes thru.

    I also tried this script:

    But Still Email from SharePoint Alerts and Workflows do not work.

    Error from ULS Log:

    Context has no SMTP/UPN claims. IdentityContext: '{"nameid":"s-1-5-21-463828705-835574391-2284018627-64022","nii":"urn:office:idp:activedirectory","upn":"enriquez@edt.net","userId":"0#.w|edt\\enriquez","appliesTo":"https:\/\/internalsite.edt.net:8443\/"}'

    Wednesday, October 16, 2019 11:47 PM
  • Hi,

    Do you have any other error message about the exception that you can share with us in the ULS logs? This error message is not specific to outgoing email configuration, I’m afraid I cannot find much useful information for you.

    Please make sure you have installed the latest CU for SharePoint Server 2016.

    Here are some posts with similar issue for your reference.

    SharePoint 2016 - ADFS - persistent cookie - office client integration - authentication prompt.

    Populating UPN in User Profile Service App without Profile Synchronization.

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5d67039b-b311-41f3-a69f-11cd28d41d51/populating-upn-in-user-profile-service-app-without-profile-synchronization?forum=sharepointadmin

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, October 18, 2019 8:06 AM
  • Hi,

    I'm checking how it is going on with this issue.

    Please remember to update this thread if you have any progress.

    Thank you for your understanding.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, October 21, 2019 7:52 AM