Skip Navigation Links
Novas Tecnologias
Ferramentas Adicionais
Ferramentas Adicionais


Dica No :
371
Assunto : SQL Server
Titulo: Enviando um EMAIL sem configurar o client MAPI

Gostou do texto ? Vote e dê sua opinião! Pontuação atual :

Translate this page now :






Adicione aos Favoritos!
BlogBlogs Rec6 Linkk Ueba Technorati Delicious DiggIt! StumbleUpon



A XP_SendMail é um recurso muito útil do sql server, mas exige a configuração de um client MAPI (outlook) no servidor de banco, o que torna seu uso complexo.

Uma forma mais simples de resolver o problema é fazer uso do CDONTS através do SQL Server. Isso dispensa a configuração do client MAPI. Claro que o exemplo abaixo é muito inferior 'as funções da xp_SendMail, mas pelo menos dispensa a configuração de um client MAPI, veja :

CREATE PROCEDURE xp_cdosendmail(
@Addr VARCHAR(255),
@Msg VARCHAR(8000),
@Subj VARCHAR(255),
@From VARCHAR(255) = 'defaultemail@domain.com') AS

DECLARE @CDO INT, @result INT, @Out INT

--Create CDONTS.NewMail object
EXECUTE @result = sp_OACreate 'CDONTS.NewMail', @CDO OUT
IF @result <> 0 PRINT 'CDONTS.NewMail'

--Call Send method of the object
EXECUTE @result = sp_OAMethod @CDO, 'Send', NULL, @From, @Addr, @Subj, @Msg,
0
IF @result <> 0 PRINT 'Send'

--Destroy CDO
EXECUTE @result = sp_OADestroy @CDO


Nome :
E-mail:
Comentarios :
 
 
Os Últimos Comentários
data: 7/26/2017 8:50:00 AM
nome: Ann Weaver
email: ryaxvjnwli@pxssvxmlkp.com
comentário:
I came across your Enviando um EMAIL sem configurar o client MAPI - B?falo Inform?tica website and wanted to let you know that we have decided to open our POWERFUL and PRIVATE website traffic system to the public for a limited time! You can sign up for our targeted traffic network with a free trial as we make this offer available again. If you need targeted traffic that is interested in your subject matter or products start your free trial today: http://v-doc.co/nm/jkfq0 Unsubscribe here: http://priscilarodrigues.com.br/url/11

data: 7/6/2017 1:02:00 AM
nome: Ann Weaver
email: wgjpldb@pzdmiqe.com
comentário:
I came to your Enviando um EMAIL sem configurar o client MAPI - B?falo Inform?tica page and noticed you could have a lot more traffic. I have found that the key to running a website is making sure the visitors you are getting are interested in your subject matter. We can send you targeted traffic and we let you try it for free. Get over 1,000 targeted visitors per day to your website. Check it out here: http://pcgroup.com.uy/15 Unsubscribe here: http://pcgroup.com.uy/2a

data: 6/29/2017 11:31:00 PM
nome: Ann Weaver
email: nisyxozhy@mwhywii.com
comentário:
I came to your Enviando um EMAIL sem configurar o client MAPI - B?falo Inform?tica page and noticed you could have a lot more traffic. I have found that the key to running a website is making sure the visitors you are getting are interested in your subject matter. We can send you targeted traffic and we let you try it for free. Get over 1,000 targeted visitors per day to your website. Check it out here: http://stpicks.com/27 Unsubscribe here: http://priscilarodrigues.com.br/url/11

data: 6/18/2017 4:12:00 AM
nome: Ann Weaver
email: qgriwiggtnb@iobggffz.com
comentário:
This is a message to the Enviando um EMAIL sem configurar o client MAPI - B?falo Inform?tica admin. Your website is missing out on at least 300 visitors per day. Our traffic system will dramatically increase your traffic to your site: http://v-doc.co/nm/jkfq0 - We offer 500 free targeted visitors during our free trial period and we offer up to 30,000 targeted visitors per month. Hope this helps :) Unsubscribe here: http://priscilarodrigues.com.br/url/11

data: 6/14/2017 9:59:00 AM
nome: Sarah Hughes
email: clzgichky@qgscaticcxt.com
comentário:
I came across your Enviando um EMAIL sem configurar o client MAPI - B?falo Inform?tica website and wanted to let you know that we have decided to open our POWERFUL and PRIVATE website traffic system to the public for a limited time! You can sign up for our targeted traffic network with a free trial as we make this offer available again. If you need targeted traffic that is interested in your subject matter or products start your free trial today: http://rofel.me/1 Unsubscribe here: http://tdil.co/5p

 1  
Dicas
Dica do Dia
Receba Dicas Por Email
E-mail :  
 


 (help)
Aceito receber informativos do devASPNet, informações de eventos e treinamentos

Veja Quais Informativos Você Receberá

Pesquisar Dicas
Pesquisar Artigos, Dicas e Noticias

Banco de Dados
Algumas Entrevistas
Links Importantes

Búfalo Informática, Treinamento e Consultoria
R. Alvaro Alvim, 37/920 Centro - Cinelândia - Rio de Janeiro Cep: 20031-010
Tel : (21) 2262-1368 (21) 9240-5134 E-mail : Contato@bufaloinfo.com.br