Sending mail with xp_sendmail

  • linkan

    Newbie

    Points: 5

    Hello,

    I have a website from where I want to send a formresult as a mail to the administrator of the site. I want send the email of the person who is logged in to the site as a replay address. I also want to send a subject and a message. The person who is sending is registered with a profile in the DB, that's from where I get the senders mail address.

    I could use cdont but after reading I found out about xp_sendmail. I have an valid mailprofile in my sql but I dont know how to actually send my mail with xp_sendmail, how do I call it and how do I send my variables?

    Thanks,

    Linkan

  • Andy Warren

    SSC Guru

    Points: 119684

    CDONTS is a better solution I think, especially if you'll be doing a large volume of email. BOL has some good examples - I'd recommend opening Query Analyzer and experimenting there first. In it's simplest form, it looks like this:

    exec master..xp_sendmail @receipients='whocares@noone.com',@subject='Test Message'

    Andy

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

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