Fórum Anexar no Outlook express #271792
10/03/2005
0
comando:
ShellExecute(Handle, ´open´, pChar(´mailto:email@email.com.br´ , ´´, ´´, SW_SHOW);
trabalho com outras formas de envio direta, sem chamar o outlook, mas neste caso preciso utilizá-lo.
[]s
Andre0201
Curtir tópico
+ 0Posts
10/03/2005
Massuda
Se quiser ter anexos na mensagem, use MAPI ou uma das bibliotecas/componentes existentes para envio de e-mail.
Gostei + 0
10/03/2005
Andre0201
Com MAPI eu consigo anexar no outlook? se sim vc tem algum material?
Gostei + 0
10/03/2005
Massuda
Gostei + 0
10/03/2005
Faelcavalcanti
function TFEMail.f_Processar(Handle: THandle; Mail: TStrings): Cardinal; type TAttachAccessArray = array [0..0] of TMapiFileDesc; PAttachAccessArray = ^TAttachAccessArray; var MapiMessage: TMapiMessage; Receip: TMapiRecipDesc; Attachments: PAttachAccessArray; AttachCount: Integer; i1: integer; FileName: string; dwRet: Cardinal; MAPI_Session: Cardinal; WndList: Pointer; begin dwRet := MapiLogon(Handle, PChar(´´), PChar(´´), MAPI_LOGON_UI or MAPI_NEW_SESSION, 0, @MAPI_Session); if (dwRet <> SUCCESS_SUCCESS) then begin MessageBox(Handle, PChar(´Erro ao tentar enviar e-mail´), PChar(´Rafael Cavalcanti - Recife-PE´), MB_ICONERROR or MB_OK); end else begin FillChar(MapiMessage, SizeOf(MapiMessage), #0); Attachments := nil; FillChar(Receip, SizeOf(Receip), 0); if Mail.Values[´to´] <> ´´ then begin Receip.ulReserved := 0; Receip.ulRecipClass := MAPI_TO; Receip.lpszName := StrNew(PChar(Mail.Values[´to´])); Receip.lpszAddress := StrNew(PChar(´SMTP:´ + Mail.Values[´to´])); Receip.ulEIDSize := 0; MapiMessage.nRecipCount := 1; MapiMessage.lpRecips := @Receip; end; AttachCount := 0; for i1 := 0 to MaxInt do begin if Mail.Values[´attachment´ + IntToStr(i1)] = ´´ then break; Inc(AttachCount); end; if AttachCount > 0 then begin GetMem(Attachments, SizeOf(TMapiFileDesc) * AttachCount); for i1 := 0 to AttachCount - 1 do begin FileName := Mail.Values[´attachment´ + IntToStr(i1)]; Attachments[i1].ulReserved := 0; Attachments[i1].flFlags := 0; Attachments[i1].nPosition := ULONG($FFFFFFFF); Attachments[i1].lpszPathName := StrNew(PChar(FileName)); Attachments[i1].lpszFileName := StrNew(PChar(ExtractFileName(FileName))); Attachments[i1].lpFileType := nil; end; MapiMessage.nFileCount := AttachCount; MapiMessage.lpFiles := @Attachments^; end; if Mail.Values[´subject´] <> ´´ then MapiMessage.lpszSubject := StrNew(PChar(Mail.Values[´subject´])); if Mail.Values[´body´] <> ´´ then MapiMessage.lpszNoteText := StrNew(PChar(Mail.Values[´body´])); WndList := DisableTaskWindows(0); try Result := MapiSendMail(MAPI_Session, Handle, MapiMessage, MAPI_DIALOG, 0); finally EnableTaskWindows( WndList ); end; for i1 := 0 to AttachCount - 1 do begin StrDispose(Attachments[i1].lpszPathName); StrDispose(Attachments[i1].lpszFileName); end; if Assigned(MapiMessage.lpszSubject) then StrDispose(MapiMessage.lpszSubject); if Assigned(MapiMessage.lpszNoteText) then StrDispose(MapiMessage.lpszNoteText); if Assigned(Receip.lpszAddress) then StrDispose(Receip.lpszAddress); if Assigned(Receip.lpszName) then StrDispose(Receip.lpszName); MapiLogOff(MAPI_Session, Handle, 0, 0); end; end;
[b:90f340b2e2]Gostaria de aproveitar este espaço para saber como faço para abrir a janela [Opções de Internet], já com a aba [Programas] aberta ??? [/b:90f340b2e2]
:wink:
Espero ter ajudado!
Gostei + 0
10/03/2005
Andre0201
Gratos
Gostei + 0
10/03/2005
Rômulo Barros
const olMailItem = 0; var Outlook: OLEVariant; MailItem: Variant; begin try Outlook:=GetActiveOleObject(´Outlook.Application´); except Outlook:=CreateOleObject(´Outlook.Application´); end; MailItem := Outlook.CreateItem(olMailItem); with MailItem do begin Recipients.Add(´email@email.com´); Subject := ´Assunto´; Body := ´corpo da mensagem´; Attachments.Add(´C:\Windows\Win.ini´); Send; end; Outlook := Unassigned; end;
WinExec(PChar(´rundll32.exe shell32.dll,´ + ´Control_RunDLL ´ + ´inetcpl.cpl´),SW_SHOWNORMAL);
Os outros itens do Painel de Controle podem ser acessados mudando-se o nome do arquivo .cpl, exemplo:
- Modem.cpl
- Netcpl.cpl
[color=red:ad0b1b4dca][b:ad0b1b4dca]Para localizar todos os arquivos .cpl q estão no painel de controle, vá na System32 do windowns e localize todos os arquivos com a extensão .cpl[/b:ad0b1b4dca][/color:ad0b1b4dca]
Gostei + 0
10/03/2005
Faelcavalcanti
Gostei + 0
10/03/2005
Rômulo Barros
:arrow: [u:343d8b235e][b:343d8b235e]Beleza !!! [/b:343d8b235e][/u:343d8b235e] :wink: :wink: :wink:
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)