Red Gate forums :: View topic - Programmatically set SMTP host
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 7
SQL Backup 7 forum

Programmatically set SMTP host

Search in SQL Backup 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Eric Nolen



Joined: 18 Sep 2009
Posts: 5

PostPosted: Mon Mar 04, 2013 7:51 pm    Post subject: Programmatically set SMTP host Reply with quote

Hi Everyone,

I wanted to see if there is a way to set the SMTP host information pragmatically rather than going through "Tools" -> "Server Options" -> "Email Settings".

Does anyone know of a way to do this?

I tried checking out the SQL Compact Database and searching for possible config files on the file system but I didn't see anywhere this information is stored on the server. I was browsing the forums as well and I have yet to find anything that might point me in the right direction.

My end goal was to setup a script/process that can go in and update the SMTP host information across all of my SQL Backup installations.

I'm running SQL Backup 7.2.1.82.
_________________
-Eric Nolen
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2276

PostPosted: Tue Mar 05, 2013 4:40 am    Post subject: Reply with quote

Try this:

Code:
EXEC master..sqbutility 1040, 'SMTPHost', 'myhost.smtp.com'
EXEC master..sqbutility 1041, 'SMTPPort', 135

_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
Eric Nolen



Joined: 18 Sep 2009
Posts: 5

PostPosted: Tue Mar 05, 2013 8:30 pm    Post subject: Reply with quote

Peter,

This is what I was looking for, I've tested it out and it seems to work fine.

Thanks for your help.

__________________________________________________________

FYI: For anyone else interested... the SQL Backup GUI must cache the email settings at some level because the only way I can get it to reflect that changes made by the stored proc call is to close out and re-enter the GUI. Even if I forced a refresh on the server it would not reflect the updated value. Thew me off for a minute when I was validating.

Also the actual values seemed to be stored in the registry here:

HKEY_LOCAL_MACHINE\SOFTWARE\Red Gate\SQL Backup\BackupSettingsGlobal\<INSTANCE>\
_________________
-Eric Nolen
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group