problem with sending mail via database mail

  • hi,

    recently we upgrade our server from 2005 to 2008.

    in 2005 we used sp_sendmail to sending mail after that don't know why it's stop working

    if anyone know then pls let me know

    and main question i am facing sending mail through database mail

    only when i add in recipients :- a particular group in which more then one user included

    i got error message like below

    exception message cannot send mails to mail server: recipients must be specified

    if i send mail to separate users then it's works fine problem comes only when i specified group into recipients

    So, can't we send mail to group using database mail

    suggestions are welcome

    and thanx in advance for your help

    Raj Acharya

  • Can you post the code that is working and the code that is not working?

  • this code works fine

    EXEC msdb..sp_send_dbmail

    @profile_name = 'admin'

    ,@recipients = 'xyz@companyname.com'

    ,@subject = @header

    ,@body_format = 'HTML'

    ,@body = @txt

    ,@from_address = 'admin@companyname.com'

    but this one is not

    EXEC msdb..sp_send_dbmail

    @profile_name = 'admin'

    ,@recipients = 'groupname'

    ,@subject = @header

    ,@body_format = 'HTML'

    ,@body = @txt

    ,@from_address = 'admin@companyname.com'

    i got the solution just need to do like this to send mail to group

    but this one is not

    EXEC msdb..sp_send_dbmail

    @profile_name = 'admin'

    ,@recipients = 'groupname@companyname.com'

    ,@subject = @header

    ,@body_format = 'HTML'

    ,@body = @txt

    ,@from_address = 'admin@companyname.com'

    and my still pending question is why sp_sendmail not works in 2008

    Raj Acharya

  • Do you mean xp_sendmail?

    MJ

  • xp_sendmail was replaced by sp_send_dbmail in sql 2005 and i believe removed completely from 2008. xp_sendmail used a MAPI profile and could therefore understand and resolve your group names just as you would in outlook. database mail (sql 2005/8) uses SMTP and therefore cannot resolve your group names and you need to specify the whole email address

  • yeh you are right ......... thank you all

    Raj Acharya

Viewing 6 posts - 1 through 5 (of 5 total)

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