sendmail.zip
|-- sendmail.ini (設定ファイル)
|-- sendmail.exe (実行ファイル)
設置後:※注意!: sendmail.exeの実行ファイルはC:\BIN 以外の場所に置いても問題ありませんが、sendmail.iniはC:\BIN以外の場所に設置する事はできません。
C:\bin\sendmail.exe
C:\bin\sendmail.ini
# SMTPサーバー名(ISPのものなど)を記入 MySMTPServer = smtp.yourispserver.tld # SMTPサーバーで認証が必要かどうかの設定 # SMTP認証が必要ない場合 0 # SMTP認証が必要である場合 1 MySMTPAuth = 0 # SMTPサーバーで認証が必要(上記MySMTPAuthが1)の場合は # ログイン名とパスワードを記入 MySMTPLogin = hogehoge MySMTPPassword = passwordディフォルトではこのようになっています。必ずMySMTPServerの部分に自宅サーバーを設置しているISPのSMTPサーバー名を記入してください。 もしISPのSMTPサーバーがSMTP認証を利用している場合は、MySQLAuthを1に設定し、MySMTPLoginにログイン名、MySMTPPasswordにパスワードを入力してください。 これでsendmail.exeの設置は終了です。
C:\>c:\bin\sendmail利用方法はいたって簡単で、sendmail -t とプログラムを開き、To: From: Subject: Cc: Bcc:など入力してください。 Cc:とBcc:はメールアドレスをカンマで区切る事で利用出来るようにしてありますので注意してください。また、To:とFrom:は必須事項ですので、 これが無い場合は自動的にプログラムが終了するようになっております。Sendmail for Windows 95/98/NT/2000/XP virsion 2.0 Your default SMTP Server: smtp.youispserver.tld ***Usage*** sendmail [ -t ] To: From: Subject: Cc: Bcc Argument. You must specify -t argument to use UNIX like sendmail. Cc: and Bcc: takes [,] comma to devide each recipient. sendmail [ -bs ] Connect to the SMTP server you specified in sendmail.ini This is also same as UNIX sendmail -bs argument. If you specify other than these options, you see this message.
open(MAIL, "|C:/bin/sendmail -t"); print MAIL "To: sombody\@somehost.tld\n"; print MAIL "From: me\@myhost.tld\n"; print MAIL "Subject: Hello world!\n\n"; print MAIL "This is a test email from sendmail.exe!"; print MAIL "\n\n"; close(MAIL);このような感じです。必ずプログラムを開く時に、-t オプションをつけてください。また、To: From:は先程も書きましたように必須事項ですので、 必ず入れてください。