omri_ori
asked on
e-mail message with client
hi.
i want to send an e-mail message from within my application. i want the folowing:
1.message sobject,body and attachment files are writen by me.
2.message is opened with default e-mail client of user so he only have to put in the adress of his friend and send.
how can i find default e-mail client?
how can i make netscape messenger to open with subject, message body and file attachments that i want?
thanks
ori
i want to send an e-mail message from within my application. i want the folowing:
1.message sobject,body and attachment files are writen by me.
2.message is opened with default e-mail client of user so he only have to put in the adress of his friend and send.
how can i find default e-mail client?
how can i make netscape messenger to open with subject, message body and file attachments that i want?
thanks
ori
ASKER
thenks for the answer but it is important to me to work with the default mail client of the user.
if he is used to work with netscape messenger i want him to have the message redy in his composer. if he is used to outlook i want the message to open in an outlook mail message window.
thenk you again
ori
if he is used to work with netscape messenger i want him to have the message redy in his composer. if he is used to outlook i want the message to open in an outlook mail message window.
thenk you again
ori
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hmmm Omri,
I think I didnt understand you till now !!
if user check his inbox with outlook he will find the message there .. if he used composer he will find it also !!
so, whats the problem !!
oh, I think you want to create a program wich checking user's inbox.
if that was the case, I think Barry is accespted.
Regards,
Hamid
I think I didnt understand you till now !!
if user check his inbox with outlook he will find the message there .. if he used composer he will find it also !!
so, whats the problem !!
oh, I think you want to create a program wich checking user's inbox.
if that was the case, I think Barry is accespted.
Regards,
Hamid
The unit is running 24 hour 7 day on the my server. Please investigation it.
unit u_ktvform;
interface
uses
Windows, Messages, SysUtils, Classes, HTTPApp, Psock, NMsmtp, Db,
DBTables;
type
TWM = class(TWebModule)
MailGonder: TNMSMTP;
TMail: TTable;
DB1: TDatabase;
TMailNo: TIntegerField;
TMailTanimi: TStringField;
TMailEmail: TStringField;
TMailKodu: TStringField;
procedure WMWebAction1Action(Sender: TObject; Request: TWebRequest;
Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
WM: TWM;
implementation
{$R *.DFM}
procedure TWM.WMWebAction1Action(Sen der: TObject; Request: TWebRequest;
Response: TWebResponse; var Handled: Boolean);
var
Dongu : integer;
begin
DB1.Open;
TMail.Open;
MailGonder.PostMessage.Bod y.Add('<st rong>Kablo Tv Baþvurusu');
MailGonder.PostMessage.Bod y.Add('Kab loTv Baþvuru Tarihi :' + DateToStr(Date));
MailGonder.PostMessage.Bod y.Add('IP No :' + Request.RemoteAddr);
MailGonder.PostMessage.Bod y.Add('<hr ><br>Ýstek Sahibinin Kimlik Belgesi </strong><br><br>');
Response.Content :=Response.Content + '<br><strong>KabloTv Baþvurusu '+
'<br>KabloTv Baþvuru Tarihi :' + DateToStr(Date)+
'<br>IP No :' + Request.RemoteAddr+
'<br><hr>';
Response.Content :=Response.Content + '<hr><br>Ýstek Sahibinin Kimlik Belgesi </strong><br><br>';
for dongu := 1 to 37 do begin
if dongu = 19 then begin
Response.Content :=Response.Content + '<hr><br><strong>Tesis Adresi </strong><br><br>';
MailGonder.PostMessage.Bod y.Add('<hr ><br><stro ng>Tesis Adresi </strong><br><br>');
end;
if dongu = 28 then begin
Response.Content :=Response.Content + '<hr><br><strong>Tesis Adresinden farklý ise tebligat adresi </strong><br><br>';
MailGonder.PostMessage.Bod y.Add('<hr ><br><stro ng>Tesis Adresinden farklý ise tebligat adresi </strong><br><br>');
end;
if dongu = 37 then begin
Response.Content :=Response.Content + '<hr>';
MailGonder.PostMessage.Bod y.Add('<hr >');
end;
MailGonder.PostMessage.Bod y.Add(Requ est.Conten tFields[do ngu]);
Response.Content :=Response.Content + Request.ContentFields[dong u]+'<br>';
end;
try
if TMail.FindKey(['SYS']) then
MailGonder.PostMessage.Fro mAddress := TMailEmail.Text;
MailGonder.PostMessage.Fro mName := TMailTanimi.Text;
MailGonder.PostMessage.Sub ject := 'Kablo TV Baþvuru Formu';
if TMail.FindKey(['KTV']) then
MailGonder.PostMessage.ToA ddress.Add (TMailEmai l.Text);
MailGonder.Connect;
MailGonder.SendMail;
Response.Content :=Response.Content + Request.RemoteAddr;
MailGonder.Disconnect;
except
Response.Content :=Response.Content + 'Mail Gitmedi';
end;
DB1.Close;
end;
unit u_ktvform;
interface
uses
Windows, Messages, SysUtils, Classes, HTTPApp, Psock, NMsmtp, Db,
DBTables;
type
TWM = class(TWebModule)
MailGonder: TNMSMTP;
TMail: TTable;
DB1: TDatabase;
TMailNo: TIntegerField;
TMailTanimi: TStringField;
TMailEmail: TStringField;
TMailKodu: TStringField;
procedure WMWebAction1Action(Sender:
Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
WM: TWM;
implementation
{$R *.DFM}
procedure TWM.WMWebAction1Action(Sen
Response: TWebResponse; var Handled: Boolean);
var
Dongu : integer;
begin
DB1.Open;
TMail.Open;
MailGonder.PostMessage.Bod
MailGonder.PostMessage.Bod
MailGonder.PostMessage.Bod
MailGonder.PostMessage.Bod
Response.Content :=Response.Content + '<br><strong>KabloTv Baþvurusu '+
'<br>KabloTv Baþvuru Tarihi :' + DateToStr(Date)+
'<br>IP No :' + Request.RemoteAddr+
'<br><hr>';
Response.Content :=Response.Content + '<hr><br>Ýstek Sahibinin Kimlik Belgesi </strong><br><br>';
for dongu := 1 to 37 do begin
if dongu = 19 then begin
Response.Content :=Response.Content + '<hr><br><strong>Tesis Adresi </strong><br><br>';
MailGonder.PostMessage.Bod
end;
if dongu = 28 then begin
Response.Content :=Response.Content + '<hr><br><strong>Tesis Adresinden farklý ise tebligat adresi </strong><br><br>';
MailGonder.PostMessage.Bod
end;
if dongu = 37 then begin
Response.Content :=Response.Content + '<hr>';
MailGonder.PostMessage.Bod
end;
MailGonder.PostMessage.Bod
Response.Content :=Response.Content + Request.ContentFields[dong
end;
try
if TMail.FindKey(['SYS']) then
MailGonder.PostMessage.Fro
MailGonder.PostMessage.Fro
MailGonder.PostMessage.Sub
if TMail.FindKey(['KTV']) then
MailGonder.PostMessage.ToA
MailGonder.Connect;
MailGonder.SendMail;
Response.Content :=Response.Content + Request.RemoteAddr;
MailGonder.Disconnect;
except
Response.Content :=Response.Content + 'Mail Gitmedi';
end;
DB1.Close;
end;
bit irrelevent to the problem at hand though isnt it..
ASKER
thenks for the answer.
It still give me a small problem if my default e-mail client is outlook. the text from buffer is entered into recipient and not in the proper locations (subject,body..).
with netscape messenger it works fine
thenks again
ori
It still give me a small problem if my default e-mail client is outlook. the text from buffer is entered into recipient and not in the proper locations (subject,body..).
with netscape messenger it works fine
thenks again
ori
for sending emails use TNMSMTP component wich comes with delphi 5 at the FastNet tab
you can use this function :
function EmailSend(SMTP: TNMSMTP; iniPath, Subject, ToAddrss, CC, BCC, aBody : String) :Boolean;
var
MyIni : TIniFile;
begin
try
MyIni := TIniFile.Create(iniPath + 'MyIni.ini');
with SMTP do begin
Host := MyIni.ReadString('Email','
Port := StrToInt(MyIni.ReadString(
UserID := MyIni.ReadString('Email','
Connect;
end;
if SMTP.Connected then begin
with SMTP.PostMessage do begin
FromAddress := MyIni.ReadString('Email', 'Email','');
FromName := MyIni.ReadString('Email', 'Name', '');
ToAddress.Text := ToAddrss;
ToCarbonCopy.Text := CC;
ToBlindCarbonCopy.Text := BCC;
Body.Text := aBody;
end;
SMTP.SendMail;
Result := True;
end else begin
// Error
Result := False;
end;
finally
MyIni.Free;
end;
end;
that function reads some info from ini File .. you can replace that with any String.
The best use of that code is to put in a general unit file for multible use with your programs.
Regards,
Hamid