November 7, 2003 at 2:02 am
If you can't send e-mail without a MAPI profile on your SQL 2000 box then how does the following script work?
http://qa.sqlservercentral.com/scripts/contributions/37.asp
I also experimented with the sp_makewebtask stored procedure to generate an HTML file with a valid SMTP header and this seemed to work too.
November 7, 2003 at 5:00 am
That is using CDONTS which are a component of IIS SMTP service (sorry I would not install). As stated natively SQL uses MAPI, third party applications and writing code for CDONTS can extend to outside protocols but that is not native. Also before you go and use CDONTS check this link out http://sqldev.net/xp/xpsmtp.htm it is quite usefull.
November 10, 2003 at 7:01 am
Instead of SendMail task, which is only cool on your personal computer, you can use a simple activeX script. It uses the CDONTS object listed in the reply above.
Prerequisite: install SMTP server.
Notice: Contact your system administrator for some tips on securing this SMTP server. It is very easy (standard properties) and it avoids that your SMTP server starts relaying spam from outside parties.
A VBscript that sends mail using this server:
'********************************************' Visual Basic ActiveX Script
'********************************************
Function Main()
'Send mail
Set oSmtp = CreateObject("CDONTS.Newmail")
oSmtp.From = "report_broadcast@noreply.com"
oSmtp.To = "Mister.Whisper@yo.com"
oSmtp.CC = "Miss.Whisper@yo.com"
oSmtp.AttachFile "Gossip.doc"
oSmtp.Subject = "Latest gossip of " & Formatdatetime(Now,2)
'2=vbShortDate
oSmtp.Body = "Put your message here"
osmtp.send
set oSmtp = nothing
Main = DTSTaskExecResult_Success
End Function
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply