Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I by-pass the "Send" button in prepared e-mail?

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

Thanks to help from subscribers to this great website I can now generate exactly what I want in "New e-mail" of Outlook Express - waiting for the "Send" button to be activated in order to transfer the e-mail to the Out Box.

How can I by-pass the "Send" button? So that the prepared e-mail goes straight to the Outbox? To await the next Send/Receive being initiated.

In case it is relevant my e-mail generating code looks like this ...

ed_Recipient := dmUsers.qrySelStoreLICENSEE.value;
ed_RecipAddress := dmUsers.qrySelStoreEMAIL.value;
strRef_Inits := dmUsers.qryUserTfrUSER_INIT.Value;
strRef := dmUsers.qryUserTfrUSER_NAME.Value;
strRefdByInits := dmUsers.qryUserTfrINTRO_INITS.Value;
strRefdBy := dmUsers.qryUserTfrINTRO_NAME.Value;
CheckDate := dmUsers.qryUserTfrDATE_REG.Value;
DecodeDate (CheckDate, StopYear, StopMonth, StopDay);
ed_Subject := 'REFERAL' + ' ' + strRef_Inits + ' ' + strRef +
' ' + 'ALREADY REFERRED BY' + ' ' + strRefdByInits + ' ' +
strRefdBy + ' ' + 'on' + ' ' +
DateToStr(dmUsers.qryUserTfrDATE_REG.Value);
if ParamCount >= 1
then FileName := ParamStr(1)
else FileName := 'c:\h\Users\PrevReg.Txt';
frmRegisterAll.Memo1.Lines.LoadFromFile(FileName);
strMsg := 'mailto:' + ed_RecipAddress +
'?Subject=' + ed_Subject +
'&Body=';
//Add first line
if frmRegisterAll.Memo1.Lines.Count > 0 then
strMsg := StrMsg + frmRegisterAll.Memo1.Lines [0];
// Add subsequent lines seperated by the newline symbol
for I := 1 to frmRegisterAll.Memo1.Lines.Count - 1 do
strMsg := strMsg + '%0D%0A' + frmRegisterAll.Memo1.Lines ;
ShellExecute (frmRegisterAll.Handle, 'open', pChar (strMsg), '', '', SW_SHOW);



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top