Database mail not working properly - sql-server

I am bit confused sending e-mail via SQL Server 2008 Management Studio. I tried all remedies discussed in most threads, but unfortunately still having the issues. Can someone help me to resolve the matter? Much appreciated!
I am getting following error, when trying to send e-mail via SSMS
The mail could not be sent to recipient because of the mail server failure...(SMTP server requires a secure connection or the client was not authenticated. The server response was 5.7.0. Must issue a STARTTLScommand first
I checked my GMail user name and password, and properly defined profile and account, port used 587.
SMTP E-mail setup done at IIS (Windows 7 PC)
Kindly advise, how can I overcome the e-mail sending issue using SSMS?

It's better to share the configuration which you have set for database mail, but anyways:
STARTTLS means the Gmail server is asking for authentication, and xp_smtp_sendmail does not provide ways for getting authenticated with Gmail or Yahoo.
Check these links ... link and link as I guess you have something wrong in your configuration there.

Related

Connecting Microsoft Report Server to Gmail

Microsoft Report Server (SQL Server) allows connection to GMail through SMTP via user / password, but does not provide support for OAuth. Google has turned off "Less Secure App" access for non-Workspace clients, and at some point in the future will probably disable LSAs all together. While we are a Workspace client and have more time to figure this out, I'm looking for help / suggestions on how to continue using GMail to send our company reports once LSAs are no longer an option.
For instance, are there any downloadable mail server applications for Windows like hMailServer that support OAuth? Unfortunately hMailServer (which we currently use) does not have OAuth support.

Is there a way to specify an SPN when using LinqPad to connect to MSSQL

We are working with SQL Server using Windows authentication and have found that we need to specify the SPN for the connection to work. Our application is partially using VB6 connecting via UDL files and partially a series of ad hoc scripts that we run through LinqPad.
Using the Server SPN feature of the UDL file we can get the connection to work but can not find the equivalent for LinqPad.
Does anyone know how to get this working? We have tried ServerSPN= as an additional connection string parameter on the Advanced settings but it is unrecognised.
Further details.
The client applications are on Windows 7 in domain A. All of the client connections are made from accounts in domain A.
The sql server is in domain B.
There is a selective one way trust between the domains and the server is added to the group that enables that trust.
The error from the linqpad connection is: "The target principal name is incorrect.Cannot generate SSPI context".
The UDL file allows the connection to work once it has the Server SPN = value set but otherwise gets the same error.
Update:
During testing we have found that specifying the SPN results in NTLM authentication to the server. Therefore if there is a way to force this from the client that would be a possible route for us.
Update + Workaround: We have stumbled across a workaround, adding the server into the hostfile with a different name seems to trigger the same fall back to NTLM authentication to work for the LinqPad connection. Would still appreciate if anyone understands how to fix this correctly but for now we are using the hostfile workaround.
Any help appreciated
I can think of several possible issues here:
Your one-way trust is set up the wrong way around;
It's too selective;
Incompatibility in AD versions between domains.
I would recommend trying Kerberos Configuration Manager for SQL Server, it might give you some insight into the root cause.
Also, I believe you might have better chances asking this on ServerFault rather than here. By the looks of it, it's a misconfiguration issue, and has nothing to do with programming.

How can I see all connection attempts with my GAE server?

I am running my application on GAE, for ex., http://example.appspot.com.
I think the standard log displays the details related to HTTP/HTTPS connections with my server. What if someone tries to connect with telnet? ftp? or any other way of connection? Or user connects with HTTPS, but with wrong certificate? Where could I see all such attempts?

SQL error when migrating data

I am currently trying to migrate databases from one server to the next, I am using a VPN to remote into one server and I am trying to move this data onto another sql server on a remote desktop server. I have been at this for a while and keep getting this error:
I am puzzled by this, because SQL authentication to log into the server where the data is located on and I use Windows Authenticaion to log onto the target server, If i try and use sql authentication it wont work, but if I type something into the username and password and then still select windows auth then the error will display whatever I typed into the username, like it needs to be sql authentication. I am not sure what to do, I tried messing with the TCP/IC ports and destination ports and I even tried connecting to the VPN on both my computer and the remote client so that I could ping both servers so I know that they can atleast communicate. My only other idea to solve this is to mess with the Server Browser and the logins stored there but im not exactly sure what im doing there and dont want to mess anything up. I am not sure what to do next so any help would be appreciated.
You need to verify that you do have the proper login and permissions for both servers and make sure that the server is configured to accept that authentication form.
Check you server settings.

How to use gmail account for ssrs email subscription

I have a report using SSRS 2008 R2, I want to subscribe to this report using the "email" option. I have configured the settings in the reporting services manager to use server as "smtp.gmail.com" and sender address as my gmail ID.
I also tried using the SMTP virtual server and relay it using smart host as "smtp.gmail.com". But I get the following error while sending email :
Failure sending mail: The transport failed to connect to the server.
I am using IIS 7 and Windows Server 2008. Following is the snippet of my rsreportserver.config file:
<SMTPServer>smtp.gmail.com</SMTPServer>
<SMTPServerPort>587
</SMTPServerPort>
<SMTPAccountName>
</SMTPAccountName>
<SMTPConnectionTimeout>
</SMTPConnectionTimeout>
<SMTPServerPickupDirectory>
</SMTPServerPickupDirectory>
<SMTPUseSSL>True
</SMTPUseSSL>
<SendUsing>2</SendUsing>
<SMTPAuthenticate></SMTPAuthenticate>
<From>myid#gmail.com</From>
Any help will be highly appreciated.
Thanks
I was having a problems getting SSRS 2017 to connect. I tried a dozen different suggestions and ended up with the following. I didn't need to setup the SMTP relay or SMTP service on the windows server.
Open Reporting Services Configuration Manager. Go to E-mail Settings >>>
Sender Address: [user]#gmail.com (or your G-Suite domain)
Current Delivery Method: Use SMTP server
SMTP Server: smtp.gmail.com
Authentication= "Username and password (basic)"
Username: [user]#gmail.com (or your G-Suite domain)
Password
Confirm Password
Use Secure Connection: Checked
Now go to the rsreportserver.config file. Mine was located at
C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\rsreportserver.config
Find the <SMTPServerPort> and set to 587
Save rsreportserver.config
You'll also need to enable "Less secure app access" in the Security section of your Google Account settings otherwise will throw authentication errors.
Having struggled with this for the past few hours I thought it might be valuable to share another method for anyone else still unable to configure an SSRS instance to send subscription emails via gmail using their smtp relay service.
For this example, my company uses Gmail Servers to host our own domain and I assume that you have access to the Admin Console on Google Apps.
Step 1 - Configure Gmail
Log into Google Apps with an Administrator Account
Go into the admin console
Select Apps > Gmail > Advanced Settings
Find SMTP Relay Service
Add New
Allowed Senders - Set to "Only Addresses In My Domains"
Authentication - Set to "Only Accept Mail From Specified IP"
Add the Public IP Range of the Server SSRS is running on
Leave TLS Encryption Unchecked
Leave SMTP Authentication Unchecked
Save
You should then have settings that look like this:
Allowed senders: Only addresses in my domains
Only accept mail from the specified IP addresses: Yes
Allowed IP addresses: (Your Description)
Require SMTP Authentication: No
Require TLS encryption: No
Step 2 - Configure SSRS
Go to SSRS Configuration Manager > Email Settings
Enter Sender address as email#yourgmaildomain.co.uk
Use SMTP Server
SMTP Server = "smtp-relay.gmail.com"
Following these steps will allow you to send emails using SSRS subscriptions without needing to set up your own relay server. Hope this helps some other poor sole from spending hours trying to figure it out!
REF:
https://support.google.com/a/answer/2956491?vid=1-635782669150538047-3380580329
From what I have read, it sounds like you might have to setup a local SMTP relay server that you send the email through, b/c SSRS requires that "The Report Server service must have Send As permissions on the SMTP server" and does not appear to give any options for entering a password. I am assuming the SSRS subscription email setup only works using Windows authentication since it uses the SSRS Service, but the configuration documentation is vague. (http://technet.microsoft.com/en-us/library/ms345234(v=sql.105).aspx )
Here is a link that shows how to setup the SMTP relay server http://www.vsysad.com/2012/04/setup-and-configure-smtp-server-on-windows-server-2008-r2/
Here are the steps you'll need to do differently.
Item 19, choose Basic Authentication, enter your gmail account info, and make sure TLS encryption is checked.
Item 21, enter your server name as the Fully-qualiified domain name. Enter "smtp.google.com" as the "Smart host".
Then specify the SMTP server you just created above in your SSRS SMTP configuration.
You probably also need to enable POP3 on your gmail account if you have not already. https://support.google.com/mail/answer/13273?cbid=wl8yzeug2lob&src=cb&lev=topic

Resources