Could not send email with attachment

  • Good morning/afternoon/evening,

    I need to send out email with attachment, there is no any problem sending email with no attachment but if there is attachment (which is on the same server in the test):

    USE msdb

    EXEC sp_send_dbmail

    @profile_name='GSH',

    @recipients='xxx@xxx.com',

    @subject='Test Attachment',

    @body='Attachment has been included in this email.',

    @file_attachments='C:\Inetpub\Apps\GSH\Log\2014-01-16.log'

    It says "Mail queued." but it will not arrive.

    sysmail_help_queue_sp @queue_type = 'Mail' returns: RECEIVES_OCCURRING

    Tried:

    EXEC sysmail_stop_sp

    EXEC sysmail_start_sp

    No luck.

    BTW, is there any restriction of the location of the attachment? can it be from a network share or it must be on the same server?

    Thanks.

  • After checked sent email using:

    msdb.dbo.sysmail_sentitems

    It turns out the test email is sent, but why it doesn't arrive in my inbox? the attachment is just pure text file. .log is not in the "prohibited attachment extensions" list

  • Finally I saw the emails with attachment, there is nothing wrong with my code or my configuration on the server, the emails arrived: not in inbox but in Junk. If I wrote the email in a non-spam way, it arrives in the inbox.

    Thanks

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply