April 21, 2010 at 1:32 pm
When I execute the following code SSMS, the e-mail is sent:
USE msdb
GO
EXEC sp_send_dbmail @profile_name='Hotmail',
@recipients='myusername@hotmail.com',
@subject='Test message',
@body='This is the body of the test message.'
However when I attempt to send mail using the Send Mail Task in SSIS which is encapsolated within a Foreach Loop Container I get the followoing error:
[Send Mail Task] Error: An error occurred with the following error message: "Mailbox unavailable. The server response was: 5.7.3 Requested action aborted; user not authenticated".
I goggled and I found the following URL but unfortunately I have not been able resolve the issue:
http://www.sqlservercentral.com/Forums/Topic495703-364-1.aspx
Regards...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 21, 2010 at 2:50 pm
I have reviewed the posted link and don't think it is the same..
I think your local SMTP server requires authentication, which the Send Mail task can't give unless it is windows authentication.
The other option is a script task and you can use this code as a basis, you'll need to handle the authentication part but this should get you started:
Dim _oSMTPClient As New SmtpClient("smtpmailhost.yourcompany.com")
Dim _oMailMsg As New MailMessage()
_oMailMsg.From = New MailAddress("someemailaddress@yourcompany.com")
_oMailMsg.To.Add("someotheremailaddress@yourcompany.com")
_oMailMsg.Subject = "The Subject"
_oMailMsg.Body = "Message Body"
_oSMTPClient.Send(_oMailMsg)
Don't forget:
Imports System.Net.Mail
CEWII
April 21, 2010 at 3:21 pm
I have been able to do this from a corporate environment using their SMTP Server.
However in this case I'm trying to do this from home running XP Pro with the SMTP Service on my PC but using the outgoing Hotmail SMTP Server "Hotmail Outgoing Mail Server (SMTP) - smtp.live.com (SSL enabled, port 25)".
I do not even know if this is possible?
Thank you.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 21, 2010 at 3:34 pm
I'm sure it is BUT you have to have a hotmail account yourself to be the FROM or at least to be able to authenticate with. The Send Mail task does not support simple authentication which is what you need..
I'm willing to bet that the DNS MX record for live.com does not work out to be smtp.live.com and that it doesn't accept email from just anybody.
The reason this works internally is that most companies have their internal SMTP server setup to take traffic from anywhere inside the organziation and not require any authentication to send it. However outside the local net it is a very different story.
CEWII
April 21, 2010 at 3:57 pm
Thank you for the information.
I got the information on the outgoing & incoming sites from the following link:
http://www.emailaddressmanager.com/tips/mail-settings.html
However I had to use Port 110 for the incoming.
You are supposed to enable SSL from Outlook when setting up the Accounts but when do so I get the following error on the Send Mail Task:
[Send Mail Task] Error: An error occurred with the following error message: "Server does not support secure connections.".
So if I understand you correctly the send mail task does not support this?
In the current project I have a Foreach Loop Container in which I have a Foreach ADO Enumerator.
Can you think of any other obstacles?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 21, 2010 at 4:00 pm
I Forgot to mention that I have a hotmail account & I'm using my Account in the From & To...
I sending myself an e-mail in this case.
Thanks.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 21, 2010 at 8:39 pm
This is from BOL:
The SMTP connection manager supports only anonymous authentication and Windows authentication. It does not support basic authentication.
This means that that what you want to do cannot be done with that task. Period.
You can start with that code I sent..
CEWII
April 22, 2010 at 5:26 am
I admit that it was a dumb question I was afraid of that.
Unfortunately there are some issues with the ISP that will prevent me from doing this in the script task.
I appreciate your feedback.
Thank you & have a great day!
Regards.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 28, 2010 at 12:12 pm
Bottle opened with a can of worms eh Elliott
I too tried sending mails via Mail task to my hotmail id that too in BCC. It just doent work as Elliott said.
CEW!!
Rex Smith
April 28, 2010 at 1:13 pm
I appreciate constructive critsism.
Thank you for those that have been respectful.
Regards.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 28, 2010 at 1:29 pm
seeteshh,
iiiii
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 28, 2010 at 1:48 pm
I think he might just have been saying "me too"..
Not sure..
CEWII
April 28, 2010 at 2:26 pm
This is from BOL:
The SMTP connection manager supports only anonymous authentication and Windows authentication. It does not support basic authentication.
This means that that what you want to do cannot be done with that task. Period.
You can start with that code I sent
Sir,
Thank you so much for your response.
I knew that this would be a problem and I expected criticism for this post for it was totally warranted.
Thank you for your feedback.
Hvae a great day!
Regards...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 28, 2010 at 2:43 pm
I'm sorry if that came off as criticism, it was not intended as such. That is what BOL says and the code provided is probably 95% of what you need to make it work.
Again, sorry.
CEWII
April 28, 2010 at 2:47 pm
Elliot,
I did not believe that what I wanted to do could be accomplished.
Thank very much for you replies.
But did you have so say the period comment?
"This means that that what you want to do cannot be done with that task."Period".
I realized that I should have not posted this question on this forum. Shame on me..
You are very intelligent but please try not to not discourage other forum members from asking questions. I know that that was not your intent and I appreciate all of your contributions to this forum.
Have a Great day and thank you for your contrubutions to this Forum.
Respectfully,
WC
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 15 posts - 1 through 15 (of 20 total)
You must be logged in to reply to this topic. Login to reply