i send email using delphi with code below which works fine. The problem is this the email account (username) that i use to send the email when i log into that account i don't see the email i sent through delphi in my sent message folder. How can i ensure that all message sent out are saved in the sent items folder here is the code below
(username is a virtual email account having Maildir format)
// Setup SMTP
SMTP.Host := edHost.Text;
SMTP.Port := 25;
SMTP.AuthenticationType := atLogin;
SMTP.UserId := 'username';
SMTP.Password := 'username';
//Setup Mail Message
MailMessage.From.Address := edFrom.Text;
//Recipients
MailMessage.Recipients.EMailAddresses := edTO.Text;
MailMessage.CCList.EMailAddresses := edCC.Text;
MailMessage.BccList.EMailAddresses := edBcc.Text;
//Message
MailMessage.Subject := edSubject.Text;
MailMessage.Body.Text := meMessage.Text;
if FileExists(edAttachment.Text) then
TIdAttachment.Create(MailMessage.MessageParts, edAttachment.Text);
//Finally Send Email
try
try
SMTP.Connect();
SMTP.Send(MailMessage);
edAttachment.Clear;
showmessage('Message Sent');
except on E:Exception do
meStatus.Lines.Insert(0, 'ERROR: ' + E.Message);
end;
finally
if SMTP.Connected then
SMTP.Disconnect;
end;
(username is a virtual email account having Maildir format)
// Setup SMTP
SMTP.Host := edHost.Text;
SMTP.Port := 25;
SMTP.AuthenticationType := atLogin;
SMTP.UserId := 'username';
SMTP.Password := 'username';
//Setup Mail Message
MailMessage.From.Address := edFrom.Text;
//Recipients
MailMessage.Recipients.EMailAddresses := edTO.Text;
MailMessage.CCList.EMailAddresses := edCC.Text;
MailMessage.BccList.EMailAddresses := edBcc.Text;
//Message
MailMessage.Subject := edSubject.Text;
MailMessage.Body.Text := meMessage.Text;
if FileExists(edAttachment.Text) then
TIdAttachment.Create(MailMessage.MessageParts, edAttachment.Text);
//Finally Send Email
try
try
SMTP.Connect();
SMTP.Send(MailMessage);
edAttachment.Clear;
showmessage('Message Sent');
except on E:Exception do
meStatus.Lines.Insert(0, 'ERROR: ' + E.Message);
end;
finally
if SMTP.Connected then
SMTP.Disconnect;
end;