Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Сети";
Текущий архив: 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);



Страницы: 1 вся ветка

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

Наверх





Память: 0.46 MB
Время: 0.007 c
3-69739
gai73
2002-04-02 10:10
2002.04.22
TQuery


1-69923
Vlad_Leon
2002-04-09 08:41
2002.04.22
Как сменить раскладку клавиатуры?


14-70005
dimich
2002-03-16 09:07
2002.04.22
Песни про Counter Strike


1-69868
VAleksey
2002-04-09 08:54
2002.04.22
Копирование каталогов


14-69975
Van
2002-03-11 11:40
2002.04.22
как определить- закончена перекачка файла или нет?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский