Function Main()
const SMTP_SERVER = "MPBAKOREX01.corp.mphasis.com"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTP_SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 90
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "ausrg@yahoo.com"
.From = "shanmuga.r@mphasis.com"
.Subject = "TEST"
.HTMLBody = "jfldsajfldk;sajf ;lksadjf;lkasdjlfkjasdlkfjlasdkj flkdsajflsadjf ljasdlf a"
.Send
End With
Main = DTSTaskExecResult_Success
End Function
When i am executing this , i am getting the following error :
Error Source : Microsoft Data Transformation Services (DTS) Package
Error Description : Error Code: 0
Error Source= CDO.Message.1
Error Description: The "SendUsing" configuration value is invalid.
Hi, I have a need to shoot and automated mail at regular intervals to clients. I got the following code for sending email from SQL Server but get an error.
ALTER PROCEDURE [dbo].[sp_SMTPMail]
@SenderName varchar(100),
@SenderAddress varchar(100),
@RecipientName varchar(100),
@RecipientAddress varchar(100),
@Subject varchar(200),
@Body varchar(8000),
@MailServer varchar(100) = 'localhost'
AS
SET nocount on
declare @oMail int --Object reference
declare @resultcode int
EXEC @resultcode = sp_OACreate 'SMTPsvg.Mailer', @oMail OUT
SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface Area Configuration" in SQL Server Books Online.
hi, i have a message queue system using sql 2005 service broker. the code and setup is the same on both dev and live database. but soon after i restored a live backup to dev. the queue stopped working on dev, live is ok thou. after some trouble shooting, i found that the server is not sending the message at all, but it says "Command(s) completed successfully" without any error messages.
setup:
-----------------------
create message type TestQueryMessage validation = none
create contract TestQueryContract (TestQueryMessage sent by initiator)
create queue TestSenderQueue
create service TestSenderService on queue TestSenderQueue
create queue TestQueueReceiver
create service TestServiceReceiver on queue TestQueueReceiver (TestQueryContract)
send message:
-------------------------
declare @conversationhandle uniqueidentifier;
begin dialog @conversationhandle
from service [TestSenderService]
to service 'TestServiceReceiver'
on contract [TestQueryContract]
with encryption = off;
send on conversation @conversationhandle
message type [TestQueryMessage] ('blah blah blah');
result:
----------------------------------
Command(s) completed successfully.
but when i do "select * from TestQueueReceiver", there's nothing. and i sure nothing else had picked up the messages.
Using SQL to send e-mail , returns the next error when sending to hotmail user.
Error,53,The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2007-03-16T09:43:38). Exception Message: Cannot send mails to mail server. (Mailbox name not allowed. The server response was: sorry<c/> that domain isn't in my list of allowed rcpthosts (#5.7.1)). ),244,79,,16.03.2007 09:43:38,sa
Hi all..I'm trying to send multiple INT values to a Stored Procedure that willbe handled in an IN statement.ASP Code:strSQL = "SP_Get_Selections '29, 32'where 29 and 32 are 2 integer valuesNow, in my stored procedure... I would like to look these values up inan IN statement likeCREATE Procedure SY_GET_SELECTIONS@authorid varchar(20)SELECT * FROM Authors WHERE AuthorID IN (@authorid)But when I use this, I get [Microsoft][ODBC SQL Server Driver][SQLServer]Syntax error converting the varchar value '29, 32' to a columnof data type int.Any help would be great.Thanks
Hi,I'm using VS2005 and I'm trying to link the C# windows form to MSSQL.I used BindingNavigator Control to read the data. After that I addsqlcommand and sqldataadapter to send the data to the database. Mycode is thissqlDataAdapter1. InsertCommand. CommandText ="INSERT INTO SUDENT (" +"S_ID, S_NAME, S_ADDRESS, S_PHONE" +") VALUES ('" +S_IDComboBox. Text + "', '" +S_NAMETextBox. Text + "', '" +S_ADDRESSTextBox. Text + "', '" +S_PHONETextBox. Text + "')";sqlDataAdapter1. InsertCommand. ExecuteNonQuery( );It gave me this error"NulleferenceExcept ion was Unhandled"and " Object refrence not set toan instance of an object" so I add this linesqlCommand1 = ("INSERT INTO STUDENT (S_ID,S_NAME, S_ADDRESS, S_PHONE)VALUES (@S_ID,@S_NAME, @S_ADDRESS, @S_PHONE) " ,sqlConnection1) ;Then it gave me some stupid error. By the way it didn't make a newobject of SqlCommand although I tired ....So can u help me to solve my problem ? Thank you
Hi, I€™m using VS2005 and I€™m trying to link the C# windows form to MSSQL. I used BindingNavigator Control to read the data. After that I add sqlcommand and sqldataadapter to send the data to the database. My code is this
First, yes I know that DB Library is depreciated. Unfortunately it isn't an option for us to make a huge change like that right now.
Now, on to the problem. We have a few different C applications that access SQL Server via db-lib. On SQL 6.5, and SQL2000 we had no issues to speak of. Since upgrading to SQL2005 (Enterprise Edition, 32 bit), we have had a horrible time with receiving an error that says "Error msg: Possible network error: Error in sending out-of-band data to SQL Server. General network error.". It appears to happen at somewhat random times during the applications run.
Search for information on "Error msg: Possible network error: Error in sending out-of-band data to SQL Server. General network error." has provided next to nothing, so I turn to you. Any ideas?
When using a subscription to send mail, I find that the report can be sent in any format apart from Excel, which gives me the error: "Failure sending mail: Unspecified error". As you can imagine, this doesn't give me much to go on!
I want to use Excel format as it retains the drilldown functionality (hiding / unhiding rows). The ExecutionLog has the status as rsSuccess, but Subscription tab for the report shows the error.
Hi, A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) I am using a direct connection from my Gridview to perform a huge database search. the stored procedure will take 10- 60 seconds to execute the query.
What the problem i am facing is when the sp takes long time (more than 1 minutes), then when i try any other operation like calling another sp frm another page, i am getting the above specified error.
I have SQL Server Reporting services on Windows 2000.
The reports seem to be working well, but I cannot get a subscription to work. The error I get is the one in the subject line.
I look into my log files and see these lines.
ReportingServicesService!emailextension!ab0!12/07/2007-15:02:07:: Error sending email. Microsoft.ReportingServices.Diagnostics.Utilities.RSException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> System.Runtime.InteropServices.COMException (0x80090005): Bad Data.
I am new to SQL 2005. I have one issue and it is as follows:
I write a simple query and run it; it works fine.
Now I break the network connection and run the query; in this case it runs fine.
But when I reconnect the network and run the query, then I get an error as follows:
"A transport-level error has occurred when sending the request to the server. (provider: Named Pipes Provider, error: 0 - An unexpected network error occurred.) "
Every thing is local here. So how the network issue comes here?
I am Getting this error in SSRS Report Subscription. I went to Subscription table Checked the Laststatus. The LastStatus is :Failure sending mail: The specified string is not in the form required for an e-mail address.Mail will not be resent.
I've tried to search on the web for a solution for this error but i didn't find any working solutions for this problem. We have 2 servers. The first one is the server we use to develop our ASP.NET 2 application. On this server we don't have this error. On the other server (use by our client) we have this error sometime and i don't know why. Both servers have the same configuration and both application have the same web.config file.
I've tried to add a try-catch and retry the query when the error occured. This seems to be working but we don't want to have to change all our connections and since we don't have this problem on the other server we want to find the source of the problem.
I have a SQL server though a hosting company and I am trying to send autoemails using xp_sendmail. The permissions were set and I used the following command to test it.
Hi everyone i get an error messgae running the following code
DECLARE @mailist VARCHAR(max) SET @mailist='' SELECT TOP 1 @mailist=@mailist + email +';' FROM email.dbo.mytable SET @mailist=STUFF(@mailist,LEN(@mailist),1,'') SET @mailist='''' + @mailist + ''''
EXEC msdb.dbo.sp_send_dbmail @profile_name='my_mail_profile', @recipients=@mailist, @subject='mysubject', @body_format='html', @body= ' <html> <head> <title> problems with send_dbmail </title> </head> <body> this is not working </body> </html> '
The error says: quote:Syntax error in parameters or arguments. The server response was: 5.5.4 Invalid Address) At the other hand, if i assign a straightforward @recipints address such as EXEC msdb.dbo.sp_send_dbmail @profile_name='my_mail_profile', @recipients=my@mail.com It works Anybody know why ? Thanks
I'm using xp_sendmail in the sp and in @query I do select * from table1. The result also page,s The formate is not at all readable and even if @attach_results = 'TRUE' In the text file its not formatted as it sends mail to my manager I want it to be formatted and looks good. Can anyone help me or Is there any way to get the results in readable format.
I need to assemble information from my outlook account into a database table. Is it possible to insert "title" of a set of mails recieved into a table ? sender's name ? recipient's name? body? etc...
Hi FolksCould anyone please tell me if there is a maximum number of E-Mailsthat SQL Server Agent can send at any one time ?I'm thinking of using it to send out matches from the database thatregistered users have previously specified.ThanksDavid
Hi I have created a Percent Log Used Alert with a threshold of 85% and am getting e-mailed with Database Mail, the problem is that I continue to get e-mailed repeatedly with the same e-mail until I disable the Alert. Is there any way to have it just e-mail it once?
How can I set the default body_format in database mail. I would like to send a warning with plain text format (from the alerts), that i'll get on my mobile phone, but the message's format is html... always...and I don't get the sms-s.
I am testing the e-mail subscriptions to my hotmail account in anticipation of sending e-mail reports to our business partners. I have made the following to the RSreportserver.config file:
Hello All,I wrote one code for sending mail by using Asp.Net+C#, My code is asfollows.private void btnSend_Click(object sender, System.EventArgs e){try{MailMessage email = new MailMessage();if(rblHtml.Checked){email.BodyFormat=MailFormat.Html;}if(rblText.Checked){email.BodyFormat=MailFormat.Text;}email.From=txtSender.Text;email.To=txtReceiver.Text;email.Subject=txtSubject.Text;email.Body=txtBody.Text;string attach1=null;if(opdAttachment1.PostedFile !=null){HttpPostedFile ulFile=opdAttachment1.PostedFile;int nFileLen=ulFile.ContentLength;if(nFileLen>0){strFileName=Path.GetFileName(opdAttachment1.Posted File.FileName);strFileName="attachment/"+strFileName;opdAttachment1.PostedFile.SaveAs(Server.MapPath(st rFileName));MailAttachment attach=newMailAttachment(Server.MapPath(strFileName));email.Attachments.Add(attach);attach1=strFileName;}}SmtpMail.SmtpServer="127.0.0.1";SmtpMail.Send(email);if(attach1 !=null){File.Delete(Server.MapPath(attach1));}lblMessage.Text="Your email has been sent successfully";catch(Exception ex){lblMessage.Visible=true;lblMessage.ForeColor=Color.Red;lblMessage.Text=ex.ToString();}When i press "SEND" button, the mail is delivered and i receive message"Your email has been sent successfully". But the mail is not deliver totarget destination.The Mail is stored in "C:Inetpubmailrootqueue" folder. After sometime, it is autometically stored in "Badmail" folder.I use Windows 2000 Professional+.net 1.1 version.I need some solution ... I am relatively new in .net .. Can anybodyhelp me please..
Hi everyone i get an error messgae running the following code
DECLARE @mailist VARCHAR(max) SET @mailist='' SELECT TOP 1 @mailist=@mailist + email +';' FROM email.dbo.mytable SET @mailist=STUFF(@mailist,LEN(@mailist),1,'') SET @mailist='''' + @mailist + ''''
EXEC msdb.dbo.sp_send_dbmail @profile_name='my_mail_profile', @recipients=@mailist, @subject='mysubject', @body_format='html', @body= ' <html> <head> <title> problems with send_dbmail </title> </head> <body> this is not working </body> </html> '
The error says:
quote:
Syntax error in parameters or arguments. The server response was: 5.5.4 Invalid Address)
At the other hand, if i assign a straightforward @recipints address such as EXEC msdb.dbo.sp_send_dbmail @profile_name='my_mail_profile', @recipients=my@mail.com
I am new to SQL Server 2005, I need Help to create a SSIS package for the below taks, My task is Refer a Column [Status] in the Logtable which is used to maintain the logs for the running processes, When ever any Rows with the "FAIL" status in Status column occurs in the LogTable then get the Respective ErrorRowNumber and get the Details of the Error from other 2, 3 tables which will be a simple SQL statements, when you get the Error Details then mail these details to the given Email id.
For this I need a help In creating a SSIS package which will continuously check the Status and if any FAIL status occurs then the Error details need to mail to mail id which are stored in the config files of SSIS package.
If any one has better idea to send the mails then please let me know.
if any online tutorial is available that will also help. Thanks in advance
Hello, I am using a script to send mails from MSSQL 2000 server. The script is trying to use the ASPMail object is located within a SQL Job or DTS package in the SQL database. It is not being run through an ASP page. The ASPMail object works fine if running in an ASP page running on win2003 server. It DOES NOT work when trying to create the object within SQL ActiveX VB script running on mssql server. If I am using this script in a job and use Microsoft's Enterprise Manager it only tells me that the job failed. If I try to use this script in a DTS package I get the error: 'Can not create object ("SMTPsvg.Mailer"). If I use a third database manager I get the following error: 'Execute permission denied on object xp_ServiceControl database' Please let me know what is causing this and how to fix it. The script goes as below '************************************************* ' Visual Basic ActiveX Script '************************************************* Dim Mailer Set Mailer = CreateObject("SMTPsvg.Mailer") Mailer.FromName = "Webmaster" Mailer.FromAddress = "webmaster@domainname.com" Mailer.RemoteHost = "mail.domainname.com" Mailer.AddRecipient "user", "mailid@domainname.com" Mailer.Subject = "Test ASP Mail" Mailer.BodyText = "Test" x = Mailer.SendMail Set Mailer = Nothing Any help is appreciated Regards
I am new to SSIS. I have a requirement that from a flat file need to import the data into SQL Server DB(SQl Server2008r2).
1.When the file doesn't found in dir need to send a mail. 2.error reading And writing ,on which record the error occurred and capture the error details and need to send mail. 3. In success also need to send a mail.