Sending email messages

Posted:
December 5th, 2006, 10:08 pm
by Gullb3rg
Hello!
I am using this:
http://delphi.about.com/od/internetintr ... 20304a.htm to make my own emailer. But the problem is that almost every SMTP need to autenciate(spell?). Like gmail or hotmail it will give me acces violation if I'm not using the right password and username.
I have found SMTP.Password and SMTP.Username. But when i but the correct options there it still gives me acces violation. Somebody have an answer at my problem. Were to fill in the User/password.
Btw, it's on SMTP.Send(MailMessage); it gives me acces violation.
/Thanks

Posted:
December 6th, 2006, 5:18 pm
by Johnny_Bit
Are you sure you use the right stuff for it? you know, newest stuff... old indy had such problems. also did you simply copy& paste the code from site or have you worked on your own? have3 you read the documentation right? does the demo work fine? man, there are many more questions, and just one request: by sole description without a code we know shit about what's happening because there are at least 20 ways to do any stuff to do same thing.

Posted:
December 6th, 2006, 7:11 pm
by Gullb3rg
The demo doesn't work either. And i have done it myself and haven't copy&paste, and i have read the doc many times. Here is the code:
- Code: Select all
procedure TForm1.SendClick(Sender: TObject);
begin
SMTP.Host := edHost.Text;
SMTP.Port := 25;
Mail.Recipients.EMailAddresses := edTo.Text;
Mail.From.Address := edFrom.Text;
Mail.Subject := edSubject.Text;
Mail.Body.Text := richMessage.Text;
if FileExists(edAttatch.Text) Then
TIdAttachment.Create(Mail.MessageParts, edAttatch.Text);
Try
SMTP.Connect(1000);
SMTP.Send(Mail);
Finally
if SMTP.Connected Then
SMTP.Disconnect;
end;
end;

Posted:
December 7th, 2006, 4:25 pm
by Johnny_Bit
have you tried service manually?
smtp port...

Posted:
January 24th, 2007, 10:04 pm
by eashton
Have you tried changing the port from 25? I think both yahoo and gmail use a different port. You will be able to get this information from their sites.
The other thing to consider is the authentication type for which information will be available on their sites.
I also recall that yahoo did not allow smtp (this can be confirmed on their web site).
Cheers
Elliot