473,729 Members | 2,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i send mail by using sql server

hi all

my query is how can i send mail by using sql server, i think by unsing
xp_sendmail store procedure we can do this but my problem is what
paramater to be pass to this store procedure if i want to send mail
from my local machine to another user, bcos i am geeting this error
msg in query analyzer...

query:-EXEC master..xp_send mail 'ss35934' (ss35934 is valid user name
present into my local nerwork)

getting error msg :- xp_sendmail: failed with mail error 0x80040111

from:- sachin shah

Aug 24 '07 #1
3 6007
On Aug 24, 7:47 am, sachin shah <sachin28...@gm ail.comwrote:
hi all

my query is how can i send mail by using sql server, i think by unsing
xp_sendmail store procedure we can do this but my problem is what
paramater to be pass to this store procedure if i want to send mail
from my local machine to another user, bcos i am geeting this error
msg in query analyzer...

query:-EXEC master..xp_send mail 'ss35934' (ss35934 is valid user name
present into my local nerwork)

getting error msg :- xp_sendmail: failed with mail error 0x80040111

from:- sachin shah
I had a similar problem and was advised not to use xp_sendmail. I
don't understand how sql server communicates with email. I don't know
the difference between using xp_sendmail (does not work) and sending a
notification email in the job scheduler (which does work)!

There's an alternative you could try which is available from
http://www.sqldev.net/xp/xpsmtp.htm
Aug 24 '07 #2
On Aug 24, 12:57 pm, stephen <m0604...@googl email.comwrote:
On Aug 24, 7:47 am, sachin shah <sachin28...@gm ail.comwrote:
hi all
my query is how can i send mail by using sql server, i think by unsing
xp_sendmail store procedure we can do this but my problem is what
paramater to be pass to this store procedure if i want to send mail
from my local machine to another user, bcos i am geeting this error
msg in query analyzer...
query:-EXEC master..xp_send mail 'ss35934' (ss35934 is valid user name
present into my local nerwork)
getting error msg :- xp_sendmail: failed with mail error 0x80040111
from:- sachin shah

I had a similar problem and was advised not to use xp_sendmail. I
don't understand how sql server communicates with email. I don't know
the difference between using xp_sendmail (does not work) and sending a
notification email in the job scheduler (which does work)!

There's an alternative you could try which is available fromhttp://www.sqldev.net/xp/xpsmtp.htm

hi stephen,

i tried with xp_smtp_sendmai l but still getting the error ....
as given into site i register the xp_smtp_sendmai l store procedure and
the assign the grant permission to that store procedure then writing
the following query

declare @rc int
exec @rc = master.dbo.xp_s mtp_sendmail
@FROM = N'*******@MyDom ain.com',
@TO = N'********@HisD omain.com'
select RC = @rc
go

in place of this 'M******@MyDoma in.com' i am writing the real mail id
(first one)
in place of this 'M*******@HisDo main.com' i am writing the real mail
id (second one)

but after executing these query getting the following error msg..

Error: connecting to server smarthost

can u plz tell me is there any sql server id we need to right into
above query (like ad***@sqlserver .com)

from sachin shah

Aug 24 '07 #3
sachin shah (sa*********@gm ail.com) writes:
as per u r guide line i insatalled that xp_smtp_sendmai l store
procedure and assign the grant permission to that SP but after
executing the following query its showing following error....

declare @rc int
exec @rc = master.dbo.xp_s mtp_sendmail
@FROM = N'*******@MyDom ain.com',
@FROM_NAME = N'My Full Name',
@replyto = N'******@systim e.net',
@TO = N'sa*********@g mail.com',
@priority = N'NORMAL',
@subject = N'Hello SQL Server SMTP Mail',
@type = N'text/plain',
@message = N'Goodbye MAPI, goodbye Outlook',
@timeout = 10000,
@server = N'mail.sqldev.n et'
select RC = @rc
go
Error Dispalyed:-
Error: sending message
Server response: 451 Local Error
put; end with <CRLF>.<CRLF>

give me the proper solution
What is says. That is a message from the SMTP server. SMTP requires
that you terminate your message with a dot on a single line. I have
never user xp_smtp_sendmai l, but apparently it does not add this dot
for you.

But you should change the SMTP server to the one that you normally use.
SMTP servers do normally not require authentication; anyone connect.
However, an SMTP server is set up to server a set of IP addresses, and if
neither the sender nor the receiver is in that set, the SMTP server should
refused to transmit the mail.
(Note :- What is this MAPI and by where it is references in sql
server )
MAPI is the mail protocol used by Outlook and other Microsoft mail
program, and it does not have much to do with SQL Server as such.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5873
by: Edward | last post by:
My computer is at intranet,I want to use following code to realizing function of sending mail.But this program only can send mail between intranet.If I send mail in internet,I need to through proxy server,the proxy method is HTTP(proxy server:xx.yyyy.com,port:8080,username/password),I want to use this program to send from intranet to internet through proxy server.I want to know how to realize this function.My code is follows: Set...
0
1443
by: Henrik Bergman | last post by:
Hi all As I subscribe MSDN I got an USB-memory with Microsoft eLearing library. I found an exampell how to send SMTP e-mail using CDO.Message object and CDO.Configuration. But when I try to send it, it answers, "The transport failed to connect to server". I suppose that means the SMTP-server. Since I used that SMTP-server several times when I send e-mail, I can't figure out why I
0
2424
by: Elankathir S.N. | last post by:
Hi All, I’m using ASP with VBScript…and I need to send mails using Lotus Notes Mail Server (IBM). How to communicate to the Lotus Notes Server and send mails??? Thanks, - Elan
2
1478
by: Senthilkumar | last post by:
Hi, I would like to send mail using Outlook or Outlook Express my .net program which is written using vb.net . When ever a new record of particular type is added, i would like to send an automatic mail using Outlook. I thought of using commercially available components but i would like to store the mails also which is not available in these components and hence the desire to use outlook. Where is the best place to start.
0
1285
by: Tidan | last post by:
Hi, I would like to send mail using Outlook Express my .net program which is written using vb.net 2.0. When ever a new record of particular type is added, i would like to send an automatic mail using Outlook Express . Where is the best place to start. Thanks
6
1712
by: AbraAbraCadabra | last post by:
Here is the code I have been using to send mail... Set objCDO = Server.CreateObject("CDO.Message") With objCDO .To = strTo .From = "markus@domain.com" .Subject = "This is the subject" .HtmlBody = "This is the Body" .Send End With
2
2042
by: Max | last post by:
hi I am using System.Web.Mail.MailMessage with System.Web.Mail.SmtpMail to send mail. now the my question is, Is it compulsory to add fields smtpauthenticate, sendusername and sendpassword fields to MailMessage Object????. mm.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
12
8690
by: Geethu03 | last post by:
Hi to all I am a new member to this group. I have a problem in Email Sending using java. That is the mail is sending from my server to any desired mail account. By using the html i created the form but i am not able to send the mail .please any one give the solution to do my project effectively. I submit the html code for example form. code: <html> <body> <table cellspacing="2" cellpadding="2" border="1"> <tr> ...
0
1770
by: PraveenKatiyar | last post by:
Hi, when i send mail using xp_smtp_sendmail it gives error--- Server response: 554 <libsoft@iitk.ac.in>: Sender address rejected: Access denied I m using-- declare @rc int exec @rc = master.dbo.xp_smtp_sendmail @FROM = 'libsoft@iitk.ac.in', -- @FROM_NAME = 'pkkatiyar',
2
7443
acoder
by: acoder | last post by:
How to Send Mail in Coldfusion You can use Coldfusion to easily send mail. From simple plain text emails to more complex HTML and multipart emails, the job is made a lot easier with Coldfusion. In the following collection of articles, we will cover the basics and gradually move onto more useful examples including using a query to send mail to multiple recipients. The <cfmail> tag If you want to send email in Coldfusion, the cfmail...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.