Sending Email From An HTML Template As The Body

Aug 28, 2006

We have a DTS package that sends smtp email from an ActiveX script task. The body of the emails are in template files that we read in and then replace values relating to the customer.

I am looking for suggestions of handling this process from an SSIS package. This is what our existing code does.



'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()
'********************************************************************************************
' Email results
'********************************************************************************************
Dim oRS, objMessage, fTemplate

Set fso = CreateObject("Scripting.FileSystemObject")

Set oRS =DTSGlobalVariables("ToBeNotified").Value
oRS.MoveFirst

Do While NOT oRS.EOF
Set objMessage = CreateObject("CDO.Message")
Set objMessage2 = CreateObject("CDO.Message")

objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = DTSGlobalVariables("RemoteSMTPServer").Value
objMessage2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = DTSGlobalVariables("RemoteSMTPServer").Value

'Server port (typically 25)
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objMessage2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "CustomerService"
objMessage2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "CustomerService"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "cslogin"
objMessage2.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "cspassword"

objMessage.Configuration.Fields.Update
objMessage2.Configuration.Fields.Update

objMessage.Sender = DTSGlobalVariables("EmailFrom").Value
objMessage2.Sender = DTSGlobalVariables("EmailFrom").Value

objMessage.From = DTSGlobalVariables("EmailFrom").Value
objMessage2.From = DTSGlobalVariables("EmailFrom").Value

objMessage.To = oRS.Fields("ContactEmail").value
' objMessage.To = "me@ourmail.com"

objMessage2.To = DTSGlobalVariables("EmailBCC").Value
' objMessage2.To = "me@ourmail.com"


If oRS.Fields("Rejected").value = 1 Then
'Rejection Message
objMessage.Subject = "electronic request notification"

If oRS.Fields("ProductType").value = "Fixed" Then
Set htmlTextStream = fso.OpenTextFile (DTSGlobalVariables("EmailTemplateRejectedFixed").Value)
Else
Set htmlTextStream = fso.OpenTextFile (DTSGlobalVariables("EmailTemplateRejectedVariable").Value)
End If

Else
'Successful results
objMessage.Subject = "electronic confirmation #" + CSTR(oRS.Fields("ConfirmationId").value)
objMessage2.Subject = "Customer request for hard copy of contract"

'Add Terms and Conditons document
termDocument = DTSGlobalVariables("TermDocumentsRepository").Value + CSTR(oRS.Fields("TermDocument").Value) + ".pdf"

If fso.FileExists(termDocument) Then
objMessage.AddAttachment termDocument
objMessage2.AddAttachment termDocument
End If

If oRS.Fields("ProductType").value = "Fixed" Then
Set htmlTextStream = fso.OpenTextFile (DTSGlobalVariables("EmailTemplateSuccessFixed").Value)
Else
Set htmlTextStream = fso.OpenTextFile (DTSGlobalVariables("EmailTemplateSuccessVariable").Value)
End If

End If

htmlText = htmlTextStream.ReadAll
htmlText = Replace( htmlText , "[OurLogo]" , DTSGlobalVariables("EmailLogo").Value)
htmlText = Replace( htmlText , "[CustomerName]" , oRS.Fields("ContactFirstName").value + " " + oRS.Fields("ContactLastName").value)

If oRS.Fields("Rejected").value = 0 Then
htmlText = Replace( htmlText , "[ConfirmNumber]" , oRS.Fields("ConfirmationId").value)
htmlText = Replace( htmlText , "[OrderDate]" , oRS.Fields("SalesDate").value)
htmlText = Replace( htmlText , "[ProductName]" , oRS.Fields("ProductType").value)
htmlText = Replace( htmlText , "[Months]" , oRS.Fields("TermMonths").value)
htmlText = Replace( htmlText , "[Price]" , oRS.Fields("SalesPrice").value)
htmlText = Replace( htmlText , "[Units]" , oRS.Fields("SalesPriceUnit").value)
htmlText = Replace( htmlText , "[StartDate]" , oRS.Fields("FlowStartDate").value)
htmlText = Replace( htmlText , "[AccountNumber]" , oRS.Fields("AccountNumber").value)
End If

objMessage.HTMLBody = htmlText
objMessage2.HTMLBody = htmlText


objMessage.Send


If oRS.Fields("SendHardCopy").value = True AND oRS.Fields("Rejected").value = 0 Then

' Attach Instructions for Hard Copy delivery
instructionDocument = DTSGlobalVariables("TermDocumentsRepository").Value + "Instructions.txt"

set file = fso.CreateTextFile(instructionDocument, true)
file.WriteLine("The customer has requested a hard copy of their contract to be sent to them.")
file.WriteLine("")
file.WriteLine("Instructions:")
file.WriteLine("1) Print the email")
file.WriteLine("2) Print the attached Terms & Conditions document")
file.WriteLine("3) Mail both items to the address below")
file.WriteLine("")
file.WriteLine("Customer Address:")
file.WriteLine(oRS.Fields("ContactFirstName").value + " " + oRS.Fields("ContactLastName").value)
file.WriteLine(oRS.Fields("BillingAddress1").value)
If oRS.Fields("BillingAddress2").value <> "" Then
file.WriteLine(oRS.Fields("BillingAddress2").value)
End If
file.WriteLine(oRS.Fields("BillingCity").value + ", " + oRS.Fields("BillingState").value + " " +oRS.Fields("BillingZip").value)
file.Close
set file=nothing

objMessage2.AddAttachment instructionDocument

fso.DeleteFile(instructionDocument)

objMessage2.Send
End If

set objMessage = nothing
set objMessage2 = nothing

oRS.MoveNext
Loop

Main = DTSTaskExecResult_Success
End Function

All suggestions are appreciated.

SK

View 1 Replies


ADVERTISEMENT

SSIS Send Email Html Body

Apr 4, 2008

Hi, I need help please.

I want to send an HTML Email

I have an Htm file that i want to use as my email body on Send Mail Task
MessageSourceType: File Connection
MessageSource: Email.htm

It sends the email with the file in the body but not in HTML format
it outputs the HTML tags + data
eg: <span style="font-size:9.0pt;">Period: 2008.04</span>

I used the same file in a DTS package & that works fine.

Please Assist!

Regards

View 2 Replies View Related

Sending File Contents In The Body Of The Email With Xp_sendmail

Jul 23, 2005

I would like to send the contents of a file using xp_sendmail howeverI do not want the file contents to be an attachment.I have no problem sending the file as an attachement.Can anybody give me an xp_sendmail example of how to do this.The results of a query can easily appear in the body of the email butall myattempts to include the contents of a file in the body of the emailhave not worked.TIA

View 1 Replies View Related

Sending Html Formatted Email Within A Stored Procedure

Oct 24, 2007

hi there,

the subject line says it all. is there a way to send nicely formatted html email from within a stored procedure that returns a dataset?

thanks!

chris

View 2 Replies View Related

Insert A Variable Into HTML Body?

Oct 18, 2013

I have created a .bat file for my sqlcmd

my sqlcmd includes a .sql file that builds up my email with a HTML body.

Is it possible to insert a variable (@customername) into the HTML body?

I am already using @maillist and select statement to create my customer email address's.

View 5 Replies View Related

SQL Server 2008 :: DBmail HTML Body Size Limit

Nov 4, 2015

When sending an email in HTML format, shouldn't this allow for 2gb of data? Mine is getting truncated after 4000 characters.

@body NVARCHAR(MAX) = NULL,

EXEC msdb.dbo.sp_send_dbmail
@recipients='someone@some.com',
@reply_to='someone'
@from_address='someone@here.com>',
@profile_name = 'profilename',
@body_format = 'HTML',
@body = 'lots of data'

View 2 Replies View Related

Placing A Web Link In An Email Body

Nov 28, 2007

I'm generating emails using sp_send_dbmail. Everything works perfectly except for one thing. In the body of the email I need to show a link to a web page (eg http://myweb/login.aspx).

The problem is that the received email shows the "link" as plain text, ie it is not a clickable link. I've tried adding char(13) (and char(10) and both) after the link text but that doesn't help.

Is there a way to make the link text a real link when received by Outlook? (All recipients will be using Outlook if that helps).

Thanks,

John

View 6 Replies View Related

Insert Trigger Not Getting Row Data For Email Body

Oct 18, 2007

hello,
need help with a simple trigger i have been working on. the trigger automatically sends me an email out when a record is inserted, how ever i can't seem to get the row column data into the email. The part i do not understand is that I get the row column data  information in the email if I update the row.
This is for 2005 SQL
Any direction would be greatly appreaciated
OneIDesigned
 

View 5 Replies View Related

Sp_send_cdosysmail - Parameter Inside Body Of Email

Jul 23, 2005

I currently have a web form posting back to a SQL table using a StoredProcedure. Part of this SP is that it pulls data from another tableand inserts a new row into the registration table.I want to have a trigger on the registration table that will fire whenthe row is inserted which will use the sp_send_cdosysmail sproc to sendan e-mail to the user.However, I want to be able to include the value of one of the fieldswithin the BODY of the message. I can't find a way to includeparameters/variables within the Body of a message usingsp_send_cdosysmail and it's driving me nuts.Here's what I have in a sproc (not a trigger) that executessp_send_cdosysmail...I currently pass a parameter for the "To" e-mailaddress and that works fine._________________________________________________EXEC sp_send_cdosysmail'fromemailaddress@testcompany.com',@stremail, <--This is the Parameter passed for the "To" e-mail addy-->'Test Subject','Test Body,Additional TextAdditional Text<--THIS IS WHERE I WANT TO PUT THE PARAMETER-->Additional TextAdditional Text'__________________________________________________ _Is there any way to do this?The sp_send_cdosysmail I used is the standard MS one..Here it is forreference:Thanks for any help offered!ElliotCREATE PROCEDURE [dbo].[sp_send_cdosysmail]@From varchar(100) ,@To varchar(100) ,@Subject varchar(100)=" ",@Body varchar(4000)/************************************************** *******************This stored procedure takes the parameters and sends an e-mail.All the mail configurations are hard-coded in the stored procedure.Comments are added to the stored procedure where necessary.References to the CDOSYS objects are at the following MSDN Web site:http://msdn.microsoft.com/library/d...s_messaging.asp************************************************** *********************/ASDeclare @iMsg intDeclare @hr intDeclare @source varchar(255)Declare @description varchar(500)Declare @output varchar(1000)--************* Create the CDO.Message Object ************************EXEC @hr = sp_OACreate 'CDO.Message', @iMsg OUT--***************Configuring the Message Object ******************-- This is to configure a remote SMTP server.--http://msdn.microsoft.com/library/d...n_sendusing.aspEXEC @hr = sp_OASetProperty @iMsg,'Configuration.fields("http://schemas.microsoft.com/cdo/configuration/sendusing").Value','1'-- This is to configure the Server Name or IP address.-- Replace MailServerName by the name or IP of your SMTP Server.EXEC @hr = sp_OASetProperty @iMsg,'Configuration.fields("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value','SMTPServer'-- Save the configurations to the message object.EXEC @hr = sp_OAMethod @iMsg, 'Configuration.Fields.Update', null-- Set the e-mail parameters.EXEC @hr = sp_OASetProperty @iMsg, 'To', @ToEXEC @hr = sp_OASetProperty @iMsg, 'From', @FromEXEC @hr = sp_OASetProperty @iMsg, 'Subject', @Subject-- If you are using HTML e-mail, use 'HTMLBody' instead of 'TextBody'.EXEC @hr = sp_OASetProperty @iMsg, 'TextBody', @BodyEXEC @hr = sp_OAMethod @iMsg, 'Send', NULL-- Sample error handling.IF @hr <>0select @hrBEGINEXEC @hr = sp_OAGetErrorInfo NULL, @source OUT, @description OUTIF @hr = 0BEGINSELECT @output = ' Source: ' + @sourcePRINT @outputSELECT @output = ' Description: ' + @descriptionPRINT @outputENDELSEBEGINPRINT ' sp_OAGetErrorInfo failed.'RETURNENDEND-- Do some error handling after each step if you have to.-- Clean up the objects created.EXEC @hr = sp_OADestroy @iMsgGO

View 2 Replies View Related

How To Send Sql/stored Procedure Output In The Body Of The Email.

Nov 3, 2007

Everyday morning I email the sql query/stored procedure output results to the users, I was wondering if I can use some kind of t-sql code or DTS packages so that I can automate this process where I want to send the sql/stored proc results in the body of the email.

View 7 Replies View Related

How To Incorporate A Table Field Into The Email Message Body Nto As An Attachment?

Oct 5, 2005

Hello everyone,

Please i need your help...

I dont know how to place the field 'strTitle and datBorrowed " in my email? Not as an attachment though....Just write it in the mail as part of message body...

I use this SQL select statement to retrieve the strTitle and datBorrowed fields

strSQL += @"Select replace(strtitle,'[Original Book] - ',''), datBorrowed from tblBooks where convert(varchar(10),datBorrowed,101) = convert(varchar(10),(getdate() - 1),101) ORDER BY strTitle asc";


Now, I have the following code to write the email

static void SendTest()
{

int iEmailLanguage = 0;
MailMessage objMail;
objMail = new MailMessage();
objMail.From = MAIL_FROM;
objMail.To =MAIL_TO;
objMail.Subject = "Books Borrowed Yesterday";
objMail.Body = Dict.GetVal(iEmailLanguage, "EMAIL_MESSAGE");
objMail.Attachments.Add(new MailAttachment(strAttachment));
SmtpMail.SmtpServer = SSMTP_SERVER;
SmtpMail.Send(objMail);
}


And the body of the email is this......


Dict.AddVal(0, "EMAIL_MESSAGE", "*** This e-mail is automatically generated. ***" +
"*** PLEASE DO NOT REPLY TO THIS E-MAIL. ***" +
"" +
"Books Borrowed Yesterday are:" +

"" +
"" +
"Thank you," +
"" +
"eLibrarian" +
"" +
"================================================== ===============" +
"" +
"This e-mail is automatically generated by the Library system." +
"Please do not reply.");



i need to put or wedge the data i got from the SQL Statement into this or after the line "Books Borrowed Yesterday are:" +

So how should i do this?

View 3 Replies View Related

Transact SQL :: Carriage Return In Email Body Within A Select Statement

Jul 2, 2015

I am trying to insert a carriage return in the select statement after the web link where I had highlighted code in bold. When I insert a record into the table, I receive the email with the message body is in single line.I need the result to look like this in the message body:

ALTER TRIGGER [dbo].[SendNotification]
ON [dbo].[TicketsHashtags]
FOR INSERT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from

[code]....

View 2 Replies View Related

Xp_smtp_sendmail Not Sending HTML File Right

Sep 27, 2007

Hello All.

I sent a HTML file as text message using xp_smtp_sendmail from my SQL server but the test email that I received doesn't look like the HTML file I have originally. Below are my codes:-

exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N'xxx@yyy.com',
@FROM_NAME = N'Mr XXX',
@TO = N'www@yyy.com',
@CC = N'kkk@yyy.com',
@priority = N'HIGH',
@subject = N'Weekly Sales To Thirds',
@type = N'text/html',
@messagefile = N'D:WSTWeeklySalesToThirds.htm',
@server = N'999.99.999.99',
@attachments = N'D:WST4weeksWST.xls'
select RC = @rc


The problem I have is the email doesn't display the HTML correctly. Spaces appeared and some of wording have wrapped.

I have attached partial screen shots of my original HTML file and email.

Please help if you have similar problem and solution. Thank you.

Best regards
Teck Boon

View 2 Replies View Related

Sending Mails In HTML Format !

Jan 9, 2007

In the DTS, using SEND MAIL TASK option !

I want to send the message in html format. When i receive in outlook 2003, it should display in html format.

How to do this ?

View 1 Replies View Related

Integration Services :: Code To Show StartDateTime And EndDateTime In Body Of Email In SSIS

Nov 23, 2015

Code to show the package StartDateTime and EndDateTime in body of the email in ssis send email task.

View 3 Replies View Related

Sending An HTML Mail Message With The Script Task

Mar 28, 2008



while i was trying to execute the code for Sending an "HTML Mail Message with the Script Task" given at the link below http://msdn2.microsoft.com/en-us/library/ms403365.aspx


following error was encountered.


DTS Script Task has encountered an exception in user code:
Project namecriptTask_098956444e9f4ae195c3565569c9444b
The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there

at Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
at ScriptTask_098956444e9f4ae195c3565569c9444b.ScriptMain.Main() in dts://Scripts/ScriptTask_098956444e9f4ae195c3565569c9444b/ScriptMain:line 29


please help me

View 7 Replies View Related

T-SQL (SS2K8) :: SSIS - Extract Data From Table And Insert In Message Body And Email To User

Jun 25, 2014

What I am trying to do, Extract the data from SQL table and Insert in Email Body and email to user. I got good article on Internet, I follow all steps as it is, but still I am getting error.

Here is the link : [URL] ....

But I am getting Error:

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at ST_7f59d09774914001b60a99a90809d5c5.csproj.ScriptMain.Main()

[Code] ....

View 4 Replies View Related

Sending An HTML Mail Message With The Script Task DOESNT WORK 4 ME

Oct 3, 2006

I set up the "Send Email Task" succesfully with "SMTP Connection to myExchangeSERVER" using "Windows Authentication"
However, as we all know - you can't have html format for the Send Mail Task. BUT this piece of code straight from MSDN doesnt work for me - each time it pops up this "Mail Sent Succesfully" - but I receive NO freaking EMAILs!!! Am I missing something or is it another one of those Microsoft "gotchas" ?

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Net.Mail

Public Class ScriptMain
Public Sub Main()
Dim htmlMessageTo As String = "me.here@mydomain.com"
Dim htmlMessageFrom As String = "SSIS@mydomain.com"
Dim htmlMessageSubject As String = "SSIS Success - My Package"
Dim htmlMessageBody As String = _
Dts.Variables("User::HTMLtemplateText").Value.ToString
Dim smtpServer As String = "myExchangeSERVER"
SendMailMessage( _
htmlMessageTo, htmlMessageFrom, _
htmlMessageSubject, htmlMessageBody, _
True, smtpServer)

Dts.TaskResult = Dts.Results.Success

End Sub

Private Sub SendMailMessage( _
ByVal SendTo As String, ByVal From As String, _
ByVal Subject As String, ByVal Body As String, _
ByVal IsBodyHtml As Boolean, ByVal Server As String)

Dim htmlMessage As MailMessage
Dim mySmtpClient As SmtpClient

htmlMessage = New MailMessage( SendTo, From, Subject, Body)
htmlMessage.IsBodyHtml = IsBodyHtml

mySmtpClient = New SmtpClient(Server)
Dim myCred As New System.Net.CredentialCache()
mySmtpClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
mySmtpClient.Send(htmlMessage)
MsgBox("Mail sent")
End Sub

View 3 Replies View Related

Sending SQL Email

Jun 20, 2005

I have developed a B2B Application which is successfully running, now the problem is that my client says that he need a process which sends report of total orders on daily bases.
 
I am using SQL Server and think that SQL Mail is a good idea, I can find many articles about which needs Outlook for that which is much difficult on the web server. Remember I need to send email only not to receive.
 
Thanks, any reply will be highly appreciated.
 

View 1 Replies View Related

Sending An Email From Within An SP

Jan 8, 2001

The following SP adds a record to a table. I want to then send an email from within this SP to notify someone that their login is blocked. I can get their email address easily with a simple select but how does the xp_sendmail procedure actually fit in ?? I've tried adding it in just before the raiserror part but it doesn't work ? The raiserror part is used to trigger an alert to notify me but i need to also notify the client. Can anyone see what i am doing wrong please. Many thanks.

CREATE PROCEDURE usp_log_BlockedLogin_ins

@LoginName varchar(50),
@IP_Address varchar(15),
@Failed_Pswd varchar(50)

AS

BEGIN

DECLARE @LoginID int

SET @LoginID = (SELECT fa_loginID FROM tbl_Login WHERE fs_LoginName = @LoginName)

INSERT into tbl_Login_Audit_Trail
(
fi_LoginID,
fs_IP_Address,
fd_DateTime,
fb_Blocked,
fs_Failed_LoginName,
fs_Failed_Password,
fb_FailedAttempt
)

VALUES
(
@LoginID,
@IP_Address,
current_timestamp,
1,
NULL,
@Failed_Pswd,
1
)
END

BEGIN
RAISERROR (50001,10,1) WITH LOG -- this is used to trigger an alert
END
GO

View 1 Replies View Related

Sending Email

Mar 9, 2001

I want to send an email to all the addresses that are contained in a table. I have tried using xp_sendmail, but I just get an error saying that xp_sendmail cannot be found.
Any ideas???

Many Thanks

View 1 Replies View Related

Sending Email

Apr 25, 2008

Ok I am going to try and explain this best as possible.
I have a report that gets everyones name who has not filled in attendance for a class. what they want is when the report is ran an email gets sent out. so I have written the sql to create a temp table that will get the distinct email.... so lets say the table consists of

jacob.ostop@synergit.com
xxxx@yyyy.com
gagsag@shsna.com


what i need to do now is get those three address and add them to a string that would be in the format of

jacob.ostop@synergit.com ; xxxx@yyyy.com ; gagsag@shsna.com

so that i can put that in the TO field of my email.
my problem is that i dont know how to get them each 1 at a time and put in semi colons..

can someone please help me!

View 1 Replies View Related

Help Sending Email

Jun 23, 2006

My code below works fine when run from my pc (changed all the values forobvious reasons). The code is placed inside a DTS task via VBS scripting.But when I try to run directly from the server where sqlserver is installed,the script fails.I have SMTP running, but there is no outlook installed.Can someone please advise what I am missing.ThanksBobSet objEmail = CreateObject("CDO.Message")objEmail.From = "send@test.com"objEmail.To = "receive@test.com"objEmail.Subject = "TEST SUBJECT"objEmail.AddAttachment "\server est.csv"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SERVER_NAME"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "userpwd"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25objEmail.Configuration.Fields.UpdateobjEmail.Sendset objEmail = nothing

View 3 Replies View Related

Send Email As HTML

Nov 16, 2005

It seems that using the Send Mail Task, there is no option for me to format my email as HTML. I have all my HTML code in a string and need to format my email to send the string as an HTML email. What would be the best way to approach this?

View 6 Replies View Related

Restarting SQL And Sending An Email

Dec 30, 1999

If SQL is restarted for any reason, I need SQL server to send emails to others letting them know that the server is has restarted once it comes back up.

Is there an Error # that I can build an Alert on? Ideas???

Thank you,
tw

View 1 Replies View Related

Sending Email From SQL Server

Nov 29, 2000

Does anyone know how to send emails from within a trigger without the use of a mail server. I know that xp_sendmail can be used if a mail server, such as MS Exchange Server is available and SQL Server is set up as an e-mail client. However is there a way to send mail to the outside world without the use of a mail server? (Perhaps there is a third party product or extended stored procedure that can give me this ability?)

Many thanks for any response.

View 1 Replies View Related

Sending Email From Sqlserver 7.0

Mar 13, 2000

Hello,

I would like to send email from Sqlserver 7.0, and I don't have a MS exchange server(I have a smtp server).
Do I need to have MS exchange server and if not, how can I get around this?
Can Outlook express be of any use?

Thanks,
yi

View 1 Replies View Related

Sending Email To Users

Sep 5, 2005

Hi,

I have a table or two in a MS SQL DB. One table has a document name, when it was last uploaded and how often it should be looked at/reviewed.

e.g.

name.doc
01/09/2005
Weekly
1

fish.doc
01/08/2005
Daily
2

Each document is associated with a user (another table) so in the above example 1 and 2 refer to theprimary key of the 'admin' table to get a user.

I want to be able to automatically send an email to users notifying them to check their documents on whatever interval they have set.

I hope this make sense!

JJ

View 1 Replies View Related

Problem Sending Email

May 14, 2007

I'm trying to send email through Integration Services (based on when a package has been executed successfully) however I get this error message:

SSIS package "CopyEmailTable.dtsx" starting.
Error: 0xC002F304 at Send Mail Task, Send Mail Task: An error occurred with the following error message: "Failure sending mail.".
Task failed: Send Mail Task
SSIS package "CopyEmailTable.dtsx" finished: Success.

Sending email via Mgmt Studio works fine, but not through Integ Services.

Any help in this is greatly appreciated!

View 2 Replies View Related

Sending Email On Insert

May 21, 2007

Hi. I found this article on 4GuysFromRolla (http://www.4guysfromrolla.com/webtech/tips/t051706-1.shtml) about sending an email when the database is updated. Well, I need to take this example a bit further. We are allowing people to enter their email address on our site to receive email updates on their case. I have all of that working in the database. But I don't know how to modify their example to loop through a listing of email addresses who want to receive an email when the case has been updated. Does anybody know how I can accomplish this? Thanks for all your help!

View 1 Replies View Related

Sending Email Sp_OAsetproperty

Jun 18, 2008

i'm using

EXEC @hr = sp_OASetProperty @object, 'HTMLBody', 'some text'

for sending email from my sql sever.

how can i make my content dynamic. So instead of 'some text' i would like to have data (results) from database; eg.: select * from table1.

is this possible anyhow?

thank you in advance

View 1 Replies View Related

Sending Email (recipients)

Jun 30, 2006

Follow-up to my original post.Is it possible for the "objEmail.To" to lookup the values from a sqlservertable?At the moment, I type the email address separated by a semi-colon.TIA~Set objEmail = CreateObject("CDO.Message")objEmail.From = "send@test.com"objEmail.To = "receive@test.com"objEmail.Subject = "TEST SUBJECT"objEmail.AddAttachment "\server est.csv"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SERVER_NAME"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "userpwd"objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25objEmail.Configuration.Fields.UpdateobjEmail.Sendset objEmail = nothing

View 1 Replies View Related

Sending Email From Sql Server

Jul 20, 2005

HiTrying to send email from sql server seems a very hard task, can iteven be done without using exchange? all examples I can find relies onexchange but I would rather send it to any SMTP server since we do notuse exchange.rgdsMatt

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved