Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Setting up Database mail using gmail account Expand / Collapse
Author
Message
Posted Sunday, April 5, 2009 11:32 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, April 9, 2009 2:46 PM
Points: 46, Visits: 56
Hi,,

any one any idea about this?

I am trying to set up Databases mail on my laptop and I have a gmail account. you know how to set that up? What is the server name for gmail account?

I am guessing either smtp.gmail.com or pop.gmail.com try to send test mail but does not work . please help me....

I get this error:
Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2009-04-05T18:20:09). Exception Message: Cannot send mails to mail server. (The specified string is not in the form required for an e-mail address.).
)
Post #690626
Posted Sunday, April 5, 2009 11:47 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, May 9, 2013 8:07 AM
Points: 1,220, Visits: 2,614
I have never set up Database Mail using Gmail, but this link may help.

http://mail.google.com/support/bin/answer.py?hl=en&answer=13287


Ken Simmons
http://twitter.com/KenSimmons
Post #690631
Posted Sunday, April 5, 2009 12:18 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, April 9, 2009 2:46 PM
Points: 46, Visits: 56
Thanks Ken,
still no joy

I dnt have company mail adress. I am at learning stages trying to get into sql server. now, since i dont have company email how can i set it up my own mail account on my computer? I know this is out of sql but sorry if u want i can start a new topic.

how can i set it up my own mail on my computer so that i can test databases mail using that? any help pleae?....

thanks,
Post #690638
Posted Sunday, April 5, 2009 3:02 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, February 15, 2012 8:42 PM
Points: 63, Visits: 121
I tried gmail - never worked.
then i tried other free POP/SMTP server hotpop.com , the smtp address is smtp.hotpop.com , port number 25
although it also failed for me, but you can try it.
Post #690656
Posted Monday, April 6, 2009 10:58 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, March 28, 2013 4:46 AM
Points: 963, Visits: 455
Your SQL server needs an SMTP server to relay your message to the destination email address.
http://mail.google.com/support/bin/answer.py?hl=en&answer=13287 tells you how to configure a client to access your gmail account to read your email.
What you are trying to achieve is to send an email from your SQL server to your gmail account. Most SMTP servers will deny relays from unknown systems. You can blame spammers the world over for that!

You don't need an email account with your company to make Database Mail work, but you do need an SMTP relay server to accept connections from your SQL box.

Is there a mail system at your company? If so, have a polite word with the email administrator and ask him if he would mind adding the IP address of your SQL server to be allowed to use the SMTP relay. If your company has its own mail system, they will have one. If they all use gmail, like you, you may be stuck!
Post #691265
Posted Monday, April 6, 2009 11:24 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, August 24, 2012 8:11 AM
Points: 1,097, Visits: 2,157
True, I tried to set it up too but never had success :~(.

I think gmail offers you some package for small organizations with some little amount to pay. that might help

Post #691286
Posted Monday, April 6, 2009 1:30 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, April 7, 2010 2:37 PM
Points: 315, Visits: 164
Try this...

Use smtp.gmail.com for the server
Change port to 465
Require secure connections checked
Basic authentication with your gmail username and password (make sure you use the full email address for username with @gmail.com at the end)


If that doesn't work, you could try installing IIS locally on your machine and run an SMTP server. Allow relay only for localhost and you should be able to use that for the server in database mail without an issue. Just make sure there isn't a firewall blocking the traffic outbound. It's an easy thing to try and it will probably work.
Post #691397
Posted Monday, April 6, 2009 2:45 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, March 28, 2013 4:46 AM
Points: 963, Visits: 455
tnolan (4/6/2009)
Try this...

Use smtp.gmail.com for the server

smtp.gmail.com is the outbound from gmail smtp server. It will refuse your relay request.


If that doesn't work, you could try installing IIS locally on your machine and run an SMTP server. Allow relay only for localhost and you should be able to use that for the server in database mail without an issue. Just make sure there isn't a firewall blocking the traffic outbound. It's an easy thing to try and it will probably work.


This might work for an email address in the same domain, but to send to external domains iis smtp needs a smarthost (smtp relay) to relay email. I think it'll present the same problem as database mail.
Post #691468
Posted Monday, April 6, 2009 4:49 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, April 7, 2010 2:37 PM
Points: 315, Visits: 164
Mark Sumner (4/6/2009)
tnolan (4/6/2009)
Try this...

Use smtp.gmail.com for the server

smtp.gmail.com is the outbound from gmail smtp server. It will refuse your relay request.


If that doesn't work, you could try installing IIS locally on your machine and run an SMTP server. Allow relay only for localhost and you should be able to use that for the server in database mail without an issue. Just make sure there isn't a firewall blocking the traffic outbound. It's an easy thing to try and it will probably work.


This might work for an email address in the same domain, but to send to external domains iis smtp needs a smarthost (smtp relay) to relay email. I think it'll present the same problem as database mail.



smtp.gmail.com actually does work. I just tested this myself. The only difference is that I had to change the port to 587. see attachment. sent to two non-gmail accounts and a gmail account as a test.


  Post Attachments 
dbmail-gmail.jpg (580 views, 49.17 KB)
Post #691554
Posted Monday, April 6, 2009 6:20 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 2:42 PM
Points: 89, Visits: 748
I have Setup Database Mail through gmail. It works absolutely fine with no issue.

Like Ajay Said, we have to use port 587. In many websites this port is given wrong.

I have explained all the steps to configure DatabaseMail through Gmail.

@ Narayan,

By default we will use port 25 to configure database mail, which is usually blocked by windows firewall for security reason,

try the following.
1. Disable firewall and test if databasemail sends email.
2. Make an exception in the windows firewall.

Or this also happens when you use wrong port numbers,

Just as an example use these values when setting up a database mail feature: You need to have a gmail account, which can be created free if you go to gmail.com, you can send email using gmail service free of cost :) So you can try this example and it works perfect.

In database mail, first create profile, and when you create an account, use these values.

Give Account name: SQL Server Alerts System
Description: XYZ

Outgoing mail Server ( SMTP)

email id: youremailid#gmail.com ( should have gmail.com)
Display Name: SQL Server
Reply email: can leave blank
Server name: smtp.gmail.com ( this is really important)
port no: 587 ( on many website this is given as 465 which is wrong, use 587 )
Check : This server requires a secure connection
Check Basic Authentication
username: youremailid@gmail.com ( should have gmail.com)
password: ( top secret , dont display ) … ;)
confirm password: confirm your password

click next and also you need to make it default public profile.

After you do this, you also have to change SQL Server Agent properties, in Properties click alerts system and then select database mail.
MOST IMRORTANT when you make changes, to SQL SERVER AGENT properties, restart only SQL SERVER AGENT.

right click SQL Server Agent and click restart, and then test your database mail.

to test, right click database mail and click send test mail… VERY IMPORTANT ( Select right profile/account from drop down list), put any email id and click send test email. click ok.

Right click database mail, select view database mail logs keep refreshing … to see if any error message had occured. mean while look in your inbox if you recieved your email.

In few days I will take screen shots on how to configure database mail, taking a live example.

All with GUI’s no scripts :)

Hope this helps.
Imran.


Reference:Click here

~ IM
Post #691581
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse