Attachments to SQL Mail

  • I am using SQL(7.0) Mail. How do I attach a file (on the hard drive, ex: D:\mydoc\test.doc) to SQL Mail?

    If I am specifying like:

    xp_sendmail @recipints = 'xyz@abc.com' , @attachments = 'D:\mydoc\test.doc'

    it then gives the error message below:

    "Server: Msg 17902, Level 18, State 1, Line 0

    General MAPI failure."

    Without an attachment, the mail works fine. I have doublechecked and the file exists on D:\mydoc

    Any help on this would be greatly appreciated.

    Thanks,

    Raghavendra Bellamkonda

  • I'm not sure why, but if you put your file in the root directory on c: and specify only name of the document, like: @attachments = 'test.doc' it will work.

    I also wish to know why it's happening, why fully qualified path to the file doesn't work. ( In my example @attachments = 'c:\test.doc' - wouldn't work either.)

    Edited by - EPol29 on 04/29/2002 09:47:51 AM

  • Has to be some sort of rights issue with either your client or the way SQL accesses your box. This is the checklist of items from Microsoft one the configuration, see if any apply.

    quote:


    Check Your Configuration

    Correcting an improper configuration can resolve the vast majority of SQL Mail problems. To make sure that you have SQL Mail configured correctly, use this list:

    You must have a mail client (such as Microsoft Outlook) installed on the computer that runs SQL Server.

    Use the Corporate or Workgroup option for Microsoft Outlook 2000 (Microsoft Outlook 2002 does not have the Corporate or Workgroup option). To select the option, on the Tools menu, click Options , and then double-click the Mail Services tab. In the Mail Services dialog box, click the Mail Support command. Microsoft Outlook 2002 does not work with SQL Mail when you use an Internet mail server unless the Outlook client is left running at all times.

    You must have a working mail server such as Microsoft Exchange or an Internet mail (Post Office Protocol 3 [POP3] or Simple Mail Transport Protocol [SMTP]) server. The outgoing mail SMTP server need not be the same as the incoming mail POP3 server; however, you must have a valid incoming mail server with a configured mail account, even if you never plan to send mail to SQL Mail.

    The account you use to start the SQL Server service must be a domain account if you are using an Exchange server. The domain account must have a mailbox on the Exchange server. If you are using an Internet mail server, you can use a local account to start SQL Server. However, the account you use to start SQL Server cannot be the Local System account, under any circumstances. The same applies to the service account you use to start the SQL Agent if you are using SQLAgentMail.

    Because mail profiles are associated with a Microsoft Windows login account, you must log on to the computer that is running SQL Server with the SQL Server service startup account in order to inspect the mail profile available to SQL Server. For example, open Control Panel. In the Control Panel dialog box, double-click Mail . In the Mail dialog box, double-click Show Profiles . If you are using SQLAgentMail and the SQL Agent service account is different from the SQL Server service account, you must also log on with the SQL Agent service startup account to inspect the mail profiles available to the SQL Agent.

    You must be able to open the mail client and test sending and receiving an e-mail to your mail server. No dialog box or message should appear that requires user action. SQL Mail uses the mail client to send mail. Because SQL Mail runs in the SQL Server service, any dialog boxes that require user interaction appear on the "virtual desktop" and do not receive a response. The lack of response causes SQL Mail to stop responding (hang).

    You must provide SQL Mail the mail profile you use to test your mail client configuration. To do so, in Enterprise Manger, open the Support Services folder. In the Support Services folder, right-click SQL Mail , and then click Properties . If you use SQLAgentMail, you must provide the mail profile to SQL Agent. To do so, in Enterprise Manager, open the Management folder, right-click SQL Agent , and then click Properties .

    The default Internet e-mail program must be the same as the mail client you use to test the mail configuration. To make sure you have the correct program, open Control Panel, double-click Internet Options , and then click the Programs tab.

    For any of the preceding changes to take effect, you must stop, and then restart the SQL Server service. If you reconfigure the default mail profile, you must restart the computer for the changes to take effect.


    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanks, Antares, I will look into this - I didn't even think that it could be the rights issue.

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

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