Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Question about xp_smtp_sendmail

Author  Topic 

kakashi
Starting Member

7 Posts

Posted - 2006-03-21 : 18:04:51
hey guys,

i'm trying to use xp_smtp_sendmail but i can only send this to the ppl in the same domain as the mail server.

i guess to send to the people outside the domain server i have to provide with usernamd and the password, is there anyway of doing this?

ref. http://www.sqldev.net/xp/xpsmtp.htm#Version_and_platform_support

my code:

declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N'test@mydomain.com',
@FROM_NAME = N'Shimmy',
@TO = N'test@outsideDomain.com',
@subject = N'test',
@message = N'test email from sql server',
@type = N'text/plain',
@server = N'mail.mydomain.com.au'
select RC = @rc
go

EDIT:
this is the error message i'm getting

Error: sending message
Server response: 550 #5.1.0 Address rejected.

kakashi
Starting Member

7 Posts

Posted - 2006-03-21 : 18:51:07
its really strange that i always manage to solve the problem soon as i post it on here.

i manage to get this working, if i use the mail server on my isp.
For example,
@FROM = N'test@ozemail.com',
@TO = N'test@hotmail.com',
@server = N'mail.SomeMailServer.com.au'

this will not work cause SomeMailServer requires a authentication. HOWEVER, if you use the mail server on ur ISP, authentication have already been authenticated when connecting to the Internet. Therefore it allows user to send email.

@FROM = N'test@ozemail.com',
@TO = N'test@hotmail.com',
@server = N'mail.MyISP.com.au'

:D
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2008-03-06 : 08:27:37
I'm now using xp_smtp_sendmail because of its HTML capabilities over my preferred xp_sendmail. However, I'm not sure if I can put a query in here. I was using the @query parameter in xp_sendmail and not sure how to do it here but that would be silly if I can't here cos this is SQL.

How do I put my query in here?

Thanks
Mike
Go to Top of Page
   

- Advertisement -