I want to setup a SMTP using gmail. How to configure it, it says,
In your email client software, under Outgoing mail, set the SMTP server to smtp.gmail.com.
Set the your username is yourgooglemailname@gmail.com and make sure "Use username and password" is checked.
Also check off "TLS" under "Use secure connection."
I tried to do this in code:
Dim htmlMessage As MailMessage
Dim mySmtpClient As SmtpClient
htmlMessage = New MailMessage(From, SendTo, Subject, Body)
htmlMessage.IsBodyHtml = IsBodyHTML
mySmtpClient = New SmtpClient(Server)
Dim myCred As New System.Net.NetworkCredential("myemail@gmail.com", "mypassword") 'CredentialCache
Under IIS SMTP I can set bounced email redirect etc. how to do that with dbmail, the idea is I can get the list of bounced emails somewhere so I can create a report.
Help with query: I currently cannot be alerted by SQL Mail so I would like to take the script that was generated by SQL server and using the store procedure sp_sqlsmtpmail to generate a email using smtp server to alert me. The store procedure does work. I would like to know if this is possible.
Thanks
Lystra
-- Script generated on 1/21/2005 10:04 AM -- By: MAMSIsa -- Server: (local)
IF (EXISTS (SELECT name FROM msdb.dbo.sysalerts WHERE name = N'Demo: Full tempdb')) ---- Delete the alert with the same name. EXECUTE msdb.dbo.sp_delete_alert @name = N'Demo: Full tempdb' BEGIN EXECUTE msdb.dbo.sp_add_alert @name = N'Demo: Full tempdb', @message_id = 9002, @severity = 0, @enabled = 1, @delay_between_responses = 10, @include_event_description_in = 5, @database_name = N'tempdb', @category_name = N'[Uncategorized]'
Then
Exec sp_sqlsmtpmail @vcTo = 'lwilliams@Huc.com', @vcBody ='Check out problem Immediataly.', @vcSubject ='DOCSITE01FDK - Full Tempdb Log'
I am running a SSIS package under a trusted account and I am running into a problem when I am executing a email task. The error is an operation timeout which was reported in the log. I am using windows authentication on the connection manager. Other email task configured the exact same way run correctly in the same run. Also when I execute task from BIDS the email is sent. Is there a bug in SSIS which would cause this behavior or some kind of exchange server configuration issue? Any help would be appreciated. Thanks, Greg
I need to set up an automatic email notification. Right now, I have a subscription that is working. The subscription runs a report and puts the resulting pdf into a folder. I need a way to notify users (preferrably in an Outlook distribution list) when the pdf is created. I'm amazed that this basic feature is not built into the subscription capabilities.
Can anyone please tell me how to best accomplish this? I'm familiar with vb.net if that helps.
Hello i am new to sqlserver 2000.i have list of email id in a table. need to fetch that emailid and send mail to the appropriate id's.any body knows how to write job schedule for this task.Ideas are welcome
I am trying to set up the email notification system in SQL server 2000, but im having some problems. Mainly, im having problems with setting up an email account in the first place (there is a dedicated mail box, but the one im working with is a different box altogether).
If anyone could help fathom this out from start to finish i would be really grateful.
Is there a handy-dandy way for me to be able, from a stored procedure, to capture the notification email address for a user associated with a job?
I need to send an email out from a stored procedure, and I want it to be set up to send to the same user that is set up in the job that calls the stored procedure.
the same notification stored proc will be used in multiple jobs, but the jobs are already set up with a notification email to be sent to the defined users "on completion" (error or not). I want a separate email to be sent, but I want to use xp_Sendmail because I have to perform a select who's output I want to appear in the body of the email (and unless I am missing something, I have no control over the body of the standard "job completion" email).
I would prefer to NOT have to "hard code" the user email address in the stored proc that calls xp_sendmail, OR to put it in some user table in the database, when the user I want to send it to will always be the same one defined in at the JOB level in Enterprise Manager.
Any thoughts? Thanks in advance for your instantaneous and informative answer-packed responses! ;)
I just wondered that now SQL Mail is classed as a legacy solution for email, does anyone know how to set up Notification Services to send email once a job has completed e.g. Backup or reindex?
I have tried to find a tutorial but with no joy so far!
I have a strange problem with a scheduled task failing with the following:
"Unable to send completion notification email to operator with email name '' for task 2780, 'Scheduled Update'"
This job is the same across several servers and the job runs on the other servers. This is a bit frustrating... I cannot seem to find the difference that is causing the problem.
The funny thing is that I am not using SQLMail or anything to notify anyone regardless if the job succeeds or fails.
within sql server management studio... we have set up a few sql scripts to run at 2am every night (sql server agent > under jobs)... although it has been successful each night, we'd like to setup sql server agent to automatically email success and failure notifications to our email boxes.
i see under the properties of sql server agent > jobs > properties of a job > there is section that says Notifications but then it doesnt really have a place to type in which email we want to send them to? some reading material or instructions greatly appreciated
Hi, My name is Vinh, I am a new bee in SQL Server 2005. I am using template script (see below) from SQL Server to create account but when I am right click in database mail for testing email and I got the message, could not connect to mail server.
Below I am trying to use smtp to connect but I know in my company we are using Exchange Mail Server. will that make a lot different?
Please help me,
Thank you very much,
sp_configure 'database mail xps', 1 GO reconfigure GO
------------------------------------------------------------- -- Database Mail Simple Configuration Template. -- -- This template creates a Database Mail profile, an SMTP account and -- associates the account to the profile. -- The template does not grant access to the new profile for -- any database principals. Use msdb.dbo.sysmail_add_principalprofile -- to grant access to the new profile for users who are not -- members of sysadmin. -------------------------------------------------------------
-- Profile name. Replace with the name for your profile SET @profile_name = 'TestProfile';
-- Account information. Replace with the information for your account.
SET @account_name = 'vdang'; SET @SMTP_servername = 'smtp.cgdnow.com'; SET @email_address = 'vdang@cdgnow.com'; SET @display_name = 'Vinh, Dang';
-- Verify the specified account and profile do not already exist. IF EXISTS (SELECT * FROM msdb.dbo.sysmail_profile WHERE name = @profile_name) BEGIN RAISERROR('The specified Database Mail profile (<profile_name,sysname,SampleProfile>) already exists.', 16, 1); GOTO done; END;
IF EXISTS (SELECT * FROM msdb.dbo.sysmail_account WHERE name = @account_name ) BEGIN RAISERROR('The specified Database Mail account (<account_name,sysname,SampleAccount>) already exists.', 16, 1) ; GOTO done; END;
-- Start a transaction before adding the account and the profile BEGIN TRANSACTION ;
IF @rv<>0 BEGIN RAISERROR('Failed to create the specified Database Mail account (<account_name,sysname,SampleAccount>).', 16, 1) ; GOTO done; END
-- Add the profile EXECUTE @rv=msdb.dbo.sysmail_add_profile_sp @profile_name = @profile_name ;
IF @rv<>0 BEGIN RAISERROR('Failed to create the specified Database Mail profile (<profile_name,sysname,SampleProfile>).', 16, 1); ROLLBACK TRANSACTION; GOTO done; END;
-- Associate the account with the profile. EXECUTE @rv=msdb.dbo.sysmail_add_profileaccount_sp @profile_name = @profile_name, @account_name = @account_name, @sequence_number = 1 ;
IF @rv<>0 BEGIN RAISERROR('Failed to associate the speficied profile with the specified account (<account_name,sysname,SampleAccount>).', 16, 1) ; ROLLBACK TRANSACTION; GOTO done; END;
I am in process of setting up job failure notification and one of the requirements that I have is to send notification to multiple users. I would appreciate any suggestion. One of the possible ways would be to create some sort of group account on exchange server with all users added as members. Is there anyway though where I could use users' individual accounts and based on that forward notification to them?
We are maintaining a database of drivers, and we are looking for a script or procedure that will automatically notify certain users of the list of drivers who are in need of a recheck or driver's license has expired. I am new to this , so any help you can give would be greatly appreciated
I receive the following error when trying to invoke xp_sendmail 'xp_sendmail: failed with mail error 0x80070005'. However, for alert notifications the email works fine. SQL is using an alias account to send mail. This account doesn't have any funny characters. Any ideas why the alert system works but xp_sendmail does not? The invokation of xp_sendmail is being done by SA.
Hi, I have RS 2000 running on windows 2003 server. I want user to subscribe to reports and receive reports via email. Initially SMTP was not installed for IIS 6.0, so I installed it and the right way (I had done it on different machine before and was succefull in that) but on this particular machines ...I don't see "Default SMTP Virtual Server" node when I open IIS manager. This is the third day I am working on this issue ..please help me out guys, prashant
I have a query which sends email notification of count of pending name and suggested name.. on a daily basis. So this works fine but now I want like if the pending and suggested are ' o count' I don't want the email notification. It should not send an email, if it is o count, but if we have the number for pending and suggested this email should be sent.
Hello dear i am using windows 2003 server where i have installed smtp server now i want to configure with remote stmp so i can send an email to any domain.
I have a report that gets sends out through a subscription and sometimes the report has multiple pages and all those pages appear within one email.Is it possible to set the subscription in such a way that an email is sent per page when the subscription executes.
I'm trying to send email from my rss script. It seems that the script cannot create an SmtpClient instance because of SmtpPermission problems, but I just can't find where I need to enable the SmtpPermission. I've tried many things, including web.config and rssrvpolicy.config.
Here's a code sample:
Public Sub Main
Dim smtpClient As New System.Net.Mail.SmtpClient
End Sub
and here's the output when I execute the above script under rs.exe against my local report server
Unhandled exception: Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089' failed.
Does anyone have any step by step instructions for how to send smtp mail from SQL? I guess I can use xp_cmdshell to run a vb script or something but I have no clue besides that as to what's involved.
Has anyone ever set up sql mail through smtp. I am trying to automate my server and not having to much success as i cannot use exchange for company reasons. I understand that i am able to set this up through outlook and not outlook express. this is what i have tried to do: 1. Remove any MAPI application (Full Outlook or Microsoft Messaging from control panel). It is important that there are no mapi profiles on the server. 2. Logon to the SQL server using the SQLService account 3. Check that Outlook Express is the default Mail client (done from IE/tools/Internet Options/Programs) 4. Check that there is a mail account configured, pointing to an SMTP server, say aklexch1 (just put bogus stuff in for the POP server) 5. test that you can send a message (ignoring the receive errors) from Outlook Express to your @advantagegroup.co.nz address
Only after step 5 is working should you start testing from SQL
6. In SQL Mail config you will not see any profiles in the list but just type 'Default' 7. Create an SQL Operator with an @advantagegroup.co.nz address and click the test button