Feb 3, 2003 #1 yomyom Programmer Dec 23, 2002 119 GB Hello, Can I send an e-mail from within my delphi 4 application? If so how? yomyom
Feb 3, 2003 #2 footpad Programmer Nov 9, 2000 1,086 US yomyom, There are a few different ways to do this, but I've documented one of the easiest at http://techtricks.com/delphi/sendmail.phpHope it helps... -- Lance Upvote 0 Downvote
yomyom, There are a few different ways to do this, but I've documented one of the easiest at http://techtricks.com/delphi/sendmail.phpHope it helps... -- Lance
Feb 3, 2003 #3 zlaja Programmer Oct 1, 2001 14 CA Yes you can. You can send it via NMSMTP(delphi5) or IDSMTP(delphi6 and delphi7) delphi5: an exemple: procedure envMsg(msgFrom, msgTo : string); var sj : string; sl : TStringList; begin //msgFrom - sender //msgTo - destination sj := YourSubject sl := TStringList.Create; sl.Add(dmp.tMsg.fieldByName('Body').asString); SMTPenvMsg.Host := YourHost(ex: 10.10.10.10); SMTPenvMsg.Port := Port (ex:25); try if SMTPenvMsg.Connected=false then SMTPenvMsg.Connect; SMTPenvMsg.PostMessage.FromAddress := msgFrom; SMTPENVmSG.PostMessage.ToAddress.Add(msgTo); SMTPenvMsg.PostMessage.Subject := sj; SMTPenvMsg.PostMessage.Body.Assign(sl); SMTPenvMsg.SendMail; sl.Free; finally SMTPenvMsg.Disconnect; end; Hope it helps you! Upvote 0 Downvote
Yes you can. You can send it via NMSMTP(delphi5) or IDSMTP(delphi6 and delphi7) delphi5: an exemple: procedure envMsg(msgFrom, msgTo : string); var sj : string; sl : TStringList; begin //msgFrom - sender //msgTo - destination sj := YourSubject sl := TStringList.Create; sl.Add(dmp.tMsg.fieldByName('Body').asString); SMTPenvMsg.Host := YourHost(ex: 10.10.10.10); SMTPenvMsg.Port := Port (ex:25); try if SMTPenvMsg.Connected=false then SMTPenvMsg.Connect; SMTPenvMsg.PostMessage.FromAddress := msgFrom; SMTPENVmSG.PostMessage.ToAddress.Add(msgTo); SMTPenvMsg.PostMessage.Subject := sj; SMTPenvMsg.PostMessage.Body.Assign(sl); SMTPenvMsg.SendMail; sl.Free; finally SMTPenvMsg.Disconnect; end; Hope it helps you!