さくらインターネットのサーバーにて、mb_send_mailでメール送信を行うページを作成しています。
というより、ずっと運用してきたサイトなのですが、今回アドレスを.jpから.co.jpドメインに変更したので、お問い合わせの宛先も.co.jpに変更したのですが、メール送信まで成功した後、サンクスページに飛ぶはずが、送信画面のURLのまま、以下のエラーが表示されます。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at support@sakura.ad.jp to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
mb_send_mailの箇所でエラーになっているようです。
試しに宛先を.jpドメインに戻すと、エラーは発生せず、.co.jpに変えるとまたエラーとなりました。
処理は以下の通りです。
php
1$header = createHeader( 利用者の入力アドレス ); 2 3mb_send_mail( 'xxxx@xxxx.co.jp' , タイトル, メールBODY, $header ); 4 5 function createHeader( $postAddress ) { 6 $header = ''; 7 // 差出人アドレス 8 $header = "From: $postAddress \n"; 9 // 返信先アドレス 10 $header .= "Reply-To:" . $postAddress . "\n"; 11 12 return $header; 13 }
なぜ.co.jp向けだけ、エラーになるのか。
解消方法がわかる方、ご教授くださいm(__)m