Can someone show me what I am doing wrong (or not doing)?
Here is my procedure code:
procedure TForm20.SendImage(const Comment, AImage: String);
var
SMTP: TIdSMTP;
Msg: TIdMessage;
begin
Msg := TIdMessage.Create(nil);
try
Msg.From.Address := 'frostydennis7@gmail.com';
Msg.Recipients.EMailAddresses := 'trevosedennis@gmail.com';
Msg.Body.Text := 'hello dennis';
Msg.Subject := 'free space';
SMTP := TIdSMTP.Create(nil);
try
SMTP.Host := 'smtp.gmail.com';
SMTP.Port := 587;
//SMTP.Port := 465; //gives different error-connection closed gracefully but
//no email is sent or received
SMTP.AuthType := satDefault;
SMTP.Username := 'frostydennis7@gmail.com';
SMTP.Password := '$$$$$$$';
SMTP.Connect;
//fails with port 25- connection time out socket error
//with port 465 it never gets past smtp connect. shows 'closed graceflly'
//with port 587 it gets past connect but then says
//'must issue a STARTTLS command first' before smtp.send(msg)
SMTP.Send(Msg);
finally
SMTP.Free;
end;
finally
Msg.Free;
end;
end;