Mail iletim raporu

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
hicker
Üye
Mesajlar: 68
Kayıt: 01 Tem 2003 09:58
Konum: Konya

Mail iletim raporu

Mesaj gönderen hicker »

Outlookta olduğu gibi mailimin alıcıya ulaşıp ulaşmadığını bir rapor halinde nasıl alabilirim? Herkese iyi çalışmalar...
mavsar

Mesaj gönderen mavsar »

Indy Bileşenleri kullanıyorsanız bu bileşenlerin o özelliği var. Fakat farklı bir yöntemle yapıyorsanız bunu bildirirseniz yardımcı olmaya çalışırım

Mehmet
hicker
Üye
Mesajlar: 68
Kayıt: 01 Tem 2003 09:58
Konum: Konya

Mesaj gönderen hicker »

Fastnet bileşenini kullanıyorum. Eğer TNMSMTP ile bu işin nasıl yapılabileceğini biliyorsanız cevabınızı bekliyorum. fastnet ile mümkün değilse de sorun değil. Indy kullanmaya başlayabilirim. sonuçta mail formunda yazılmış pek uzun bi kod yok.
yardımın için teşekkür ederim...
mavsar

Mesaj gönderen mavsar »

Selam Hocam.

Yaptığım kısa ve hızlı araştırmada Fastnet'e ilişkin bir şey bulamadım. Fakat aşağıdaki kod senin mail adresini kontrol etmen için yeterli olacaktır. Eğer mail karşı serverdan geri gelmişse (Mail Router geri yolladıysa) sen bunu accountunu kontrol edip Mail router içinden okuyabilirsin. Ayrıca bu işleri ICS (Internet Component Suite) -ki daha önceden bunu nereden download edilebileceğini yazmıştım. Forumda aratabilirsin- veya Indy kullanman. Bu konuda daha detaylı bilgiyi http://groups.yahoo.com adresinden aratacağın (ICS, Indy) mail gruplarından daha kolay takip edebilirsin. Bu kadar laftan sonra belirttiğim kodu ekliyorum.

Kod: Tümünü seç

unit email;

interface

function AddrOK( S: String): Boolean;

implementation


function NameOK( S: String): Boolean;
const ValidChars = [' '..'~'];
var I: Integer;
begin
Result := False;
{ Check for invalid characters }
for I := 1 to length( S) do
     if not (S[ I] in ValidChars) then
          exit;
{ Check for dot at beginning or end }
if (S[ 1] = '.') or (S[ Length( S)] = '.') then
     exit;
Result := True;
end;


function HostOK( S: String): Boolean;
const ValidChars = ['A'..'Z','a'..'z','0'..'9','-','.'];
var I: Integer;
begin
Result := False;
{ Check for invalid characters }
for I := 1 to length( S) do
     if not (S[ I] in ValidChars) then
          exit;
{ Check for missing dot }
if Pos( '.', S) = 0 then
     exit;
{ Check for dot at beginning or end }
if (S[ 1] = '.') or (S[ Length( S)] = '.') then
     exit;
Result := True;
end;


function AddrOK( S: String): Boolean;
var
     Name, Host: String;
     I: Integer;
begin
result := false;

I := pos( '@', S);
if (I <= 1) or ( I = length( S)) then
     exit;
Name := Copy( S, 1, I-1);
Host := Copy( S, I+1, length( S) - I);

if NameOK( Name) and HostOK( Host) then
     result := true;
end;

end.
____________________________________________________________________________

From: Andrea Laforgia <andrea_laforgia@bigfoot.com>

program EmailValidatorPrg ;

(* Andrea Laforgia 2000 *)
(* $APPTYPE CONSOLE *)

uses SysUtils ;

const IdentifierChars = ['A'..'Z','a'..'z','0'..'9','_'] ;

type TokenType = ( TK_PERIOD, // . found
                   TK_AT,     // @ found
                   TK_STR,    // concatenation of characters
                   TK_EOEA ); // end of email address

var EmailAddress : string ;

function NextToken( var S, Token : string ) : TokenType ;
begin
  Token := '' ;
  while ( S <> '' ) and ( S[1] = ' ' ) do
    delete( S, 1, 1 ) ;
  if ( S <> '' ) then
  begin
    if ( S[1] in IdentifierChars ) then
    begin
      while ( S <> '' ) and
            ( S[1] in IdentifierChars ) do
      begin
        Token := Token + S[1] ;
        delete( S, 1, 1 ) ;
      end ;
      Result := TK_STR ;
    end
    else
    begin
      case S[1] of
        '.' : Result := TK_PERIOD ;
        '@' : Result := TK_AT ;
      end ;
      delete( S, 1, 1 ) ;
    end
  end
  else Result := TK_EOEA ;
end ;  // NextToken

function EmailValidator( EmailAddress : string ) : boolean ;
var EmailToken : string ;
    Token      : TokenType ;
    State      : integer ;
begin
  State := 0 ;
  while ( State <> 100 ) do
  begin
    Token := NextToken( EmailAddress, EmailToken ) ;
    case State of
        -1 : begin
               Result := false ;
               State  := 100 ;
             end ;

         0 : case Token of
               TK_STR : State := 1 ;
             else
               State := -1 ;
             end ;

         1 : case Token of
               TK_PERIOD : State := 0 ;
               TK_AT     : State := 2 ;
             else
               State := -1 ;
             end ;

         2 : case Token of
               TK_STR : State := 3 ;
             else
               State := -1 ;
             end ;

         3 : case Token of
               TK_PERIOD : State := 4 ;
             else
               State := -1 ;
             end ;

         4 : case Token of
               TK_STR : State := 5 ;
             else
               State := -1 ;
             end ;

         5 : case Token of
               TK_PERIOD : State := 4 ;
               TK_EOEA   : State := 99 ;
             else
               State := -1 ;
             end ;
        99 : begin
               Result := true ;
               State  := 100 ;
             end ;
    end ;
  end ;
end ;  // EmailValidator

begin
  write( 'Write an e-mail address : ' ) ;

  readln( EmailAddress ) ;

  if ( EmailValidator( EmailAddress ) ) then
     writeln( 'The e-mail address is correct' )
  else
     writeln( 'The e-mail address is wrong !' ) ;
end.
Bunu yazan arkadaşa 57008830 ICQ adresinden ulaşabilirsin.

Selamlar,

Mehmet
Cevapla