Форум: "Сети";
Поиск по всему сайту: delphimaster.net;
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];




Вниз

Почтовая программа 


Sligger   (2002-02-08 20:44) [0]

Приветствую всех!
Возможно, этот вопрос уже звучал но всё-же: Запустить почтовую программу в режиме создания письма просто:
ShellExecute(0, nil," http://delphi.mastak.com",nil,nil,1);
А как вставить в неё тему и часть самого текста письма?
Заранее благодарен.



VuDZ   (2002-02-09 01:17) [1]

MAPISendMail()
ULONG FAR PASCAL MAPISendMail(
LHANDLE lhSession,
ULONG ulUIParam,
lpMapiMessage lpMessage,
FLAGS flFlags,
ULONG ulReserved
)


.....
lpMessage
[in] Pointer to a MapiMessage structure containing the message to be sent. If the MAPI_DIALOG flag is not set, the nRecipCount and lpRecips members must be valid for successful message delivery. Client applications can set the flFlags member to MAPI_RECEIPT_REQUESTED to request a read report. All other members are ignored and unused pointers should be NULL.
....

MapiMessage (Simple MAPI)
A MapiMessage structure contains information about a message.

Quick Info
Header file: MAPI.H


typedef struct {
ULONG ulReserved;
LPTSTR lpszSubject;
LPTSTR lpszNoteText;
LPTSTR lpszMessageType;
LPTSTR lpszDateReceived;
LPTSTR lpszConversationID;
FLAGS flFlags;
lpMapiRecipDesc lpOriginator;
ULONG nRecipCount;
lpMapiRecipDesc lpRecips;
ULONG nFileCount;
lpMapiFileDesc lpFiles;
} MapiMessage, FAR *lpMapiMessage;

Members
ulReserved
Reserved; must be zero.
lpszSubject Pointer to the text string describing the message subject, typically limited to 256 characters or less. If this member is empty or NULL, the user has not entered subject text.
lpszNoteText
Pointer to a string containing the message text. If this member is empty or NULL, there is no message text.
lpszMessageType
Pointer to a string indicating a non-IPM type of message. Client applications can select message types for their non-IPM messages. Clients that only support IPM messages can ignore the lpszMessageType member when reading messages and set it to empty or NULL when sending messages.
lpszDateReceived
Pointer to a string indicating the date when the message was received. The format is YYYY/MM/DD HH:MM, using a 24-hour clock.
lpszConversationID
Pointer to a string identifying the conversation thread to which the message belongs. Some messaging systems can ignore and not return this member.
flFlags
Bitmask of message status flags. The following flags can be set:
MAPI_RECEIPT_REQUESTED
A receipt notification is requested. Client applications set this flag when sending a message.
MAPI_SENT
The message has been sent.
MAPI_UNREAD
The message has not been read.
lpOriginator
Pointer to a MapiRecipDesc structure containing information about the sender of the message.
nRecipCount
The number of message recipient structures in the array pointed to by the lpRecips member. A value of zero indicates no recipients are included.
lpRecips
Pointer to an array of MapiRecipDesc structures, each containing information about a message recipient.
nFileCount
The number of structures describing file attachments in the array pointed to by the lpFiles member. A value of zero indicates no file attachments are included.
lpFiles
Pointer to an array of MapiFileDesc structures, each containing information about a file attachment.



copyr25   (2002-02-09 02:43) [2]

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
NMsmtp, Psock, NMpop3, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
NMPOP31: TNMPOP3;
NMSMTP1: TNMSMTP;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
oLogon: TNMPop3;
oMail: TNMSmtp;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
oLogon := TNMPop3.Create(self);
try
with oLogon do begin
Host := "pop.mail.yahoo.com";
UserID := "copyr25";
Password := "password";
end;
oLogon.Connect;
// Delay
oLogon.Disconnect;
finally
oLogon.Free;
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
oMail := TNMSmtp.Create(self);
with oMail do
begin
try
Host := "smtp.mail.yahoo.com";
Port := 25;
UserID := "copyr25";
Connect;
SubType := mtHTML;
{ set all other properties, e. g. FromName, FromAddress, ReplyTo, Subject, etc }
PostMessage.FromAddress := "copyr25@yahoo.com";
PostMessage.FromName := "Name";
PostMessage.Subject := "No Subject";
PostMessage.ToAddress.Add("copyr25@yahoo.com");
PostMessage.Body.Add("<html> <head> </head>");
PostMessage.Body.Add("<body> My 1st html - message </body>");
PostMessage.Body.Add("</html>");
Connect;
SendMail;
Disconnect;
finally
Free;
end;
end;
end;

end.



Anatoly Podgoretsky   (2002-02-09 11:57) [3]

ShellExecute(Handle,"open","mailto:sligger@mail.ru?subject=Это%20тема&body=это%20текст%20письма%0dЭто%20другая%20строка",nil,nil,SW_SHOWNORMAL);




Форум: "Сети";
Поиск по всему сайту: delphimaster.net;
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];




Наверх





Память: 0.73 MB
Время: 0.06 c
1-69775           snoup                 2002-04-07 21:38  2002.04.22  
Как сделать скриншот своей проги?


1-69902           wHammer               2002-04-09 13:56  2002.04.22  
TAB


14-70014          Иван Шихалев          2002-03-17 14:09  2002.04.22  
to Merlin


14-69971          Merlin                2002-03-13 18:49  2002.04.22  
СПАМ на delphi@mastak.com


4-70055           Wladimir              2002-02-15 22:38  2002.04.22  
Время создания файла.