Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Setting up Database mail using gmail account


Setting up Database mail using gmail account

Author
Message
Achtang
Achtang
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 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 Sad. 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.).
)

KenSimmons
KenSimmons
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1222 Visits: 2614
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
Achtang
Achtang
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 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,
Boolean_z
Boolean_z
Valued Member
Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)

Group: General Forum Members
Points: 69 Visits: 122
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.
Mark Sumner
Mark Sumner
SSC Eights!
SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)

Group: General Forum Members
Points: 967 Visits: 456
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!
maechismo_8514
maechismo_8514
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1108 Visits: 2228
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:-P
tcnolan
tcnolan
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 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.
Mark Sumner
Mark Sumner
SSC Eights!
SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)SSC Eights! (967 reputation)

Group: General Forum Members
Points: 967 Visits: 456
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.
tcnolan
tcnolan
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 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.
Attachments
dbmail-gmail.jpg (603 views, 49.00 KB)
sayfrend
sayfrend
SSC Journeyman
SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)

Group: General Forum Members
Points: 97 Visits: 750
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 Smile 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 ) … Wink
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 Smile

Hope this helps.
Imran.


Reference:Click here

~ IM
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search