개발! 딱 깔끔하고 센스있게!

PHP Mailer 와 Amazon SES 를 사용 합 니 다. 본문

개발 스크랩 메모/PHP

PHP Mailer 와 Amazon SES 를 사용 합 니 다.

렉사이 2020. 11. 30. 23:51

아마 존 S 를 쓰 고 있 습 니 다.

나 는 PHP Mailer 를 사용 하여 내 PHP 스 크 립 트 로부터 이메일 을 보 내 려 고 시도 하고 있다.

메 일 아 이 디 를 확인 하고 메 일 아 이 디 로 메 일 을 보 내 려 고 합 니 다.

그러나 이 는 다음 과 같은 실 수 를 던 졌 다.

잘못

SERVER -> CLIENT: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-693939519 QEPGeLndQQq5vJ53VMXU CLIENT -> SERVER: EHLO localhost SERVER -> CLIENT: 250-email-smtp.amazonaws.com250-8BITMIME250-SIZE 10485760250- STARTTLS250-AUTH PLAIN LOGIN250 Ok CLIENT -> SERVER: STARTTLS SERVER -> CLIENT: 220 Ready to start TLS CLIENT -> SERVER: EHLO localhost SERVER -> CLIENT: 250-email-smtp.amazonaws.com250-8BITMIME250-SIZE 10485760250-STARTTLS250-AUTH PLAIN LOGIN250 Ok CLIENT -> SERVER: AUTH LOGIN SMTP NOTICE: EOF caught while checking if connected SMTP connect() failed. Mailer Error: SMTP connect() failed. 

다음은 내 PHP 스 크 립 트:

isSMTP(); //Enable SMTP debugging $mail->SMTPDebug = 2; //Ask for HTML-friendly debug output $mail->Debugoutput = 'html'; //Set the hostname of the mail server $mail->Host = 'email-smtp.us-east-1.amazonaws.com'; //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission // I tried PORT 25, 465 too $mail->Port = 587; //Set the encryption system to use - ssl (deprecated) or tls $mail->SMTPSecure = 'tls'; //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication - use full email address for gmail $mail->Username = "SES Secret ID"; //Password to use for SMTP authentication $mail->Password = "SES Secret Key"; //Set who the message is to be sent from $mail->setFrom('[email protected]', 'sender'); //Set who the message is to be sent to $mail->addAddress('[email protected]', 'receiver'); //Set the subject line $mail->Subject = 'PHPMailer GMail SMTP test'; $mail->Body = 'This is a plain-text message body'; //Replace the plain text body with one created manually $mail->AltBody = 'This is a plain-text message body'; //send the message, check for errors if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?> 

나 는 인터넷 에서 많은 해결 방안 을 찾 았 다.

특히 stackover flow.

아무것도 안 돼!!

대답 하 다.

나 는 방법 을 강구 하여 해 냈 다.

$ mail-> Port = 587; // Username to use for SMTP authentication - use full email address for gmail $ mail-> Username = "Amazon SES Secret ID"; // Password to use for SMTP authentication $ mail-> Password = "Amazon SES Secret Key"; 

증명 서 를 만 들 려 면 아래 링크 를 방문 하 십시오: htps: / console. aws. amazon. com, / ses / home?지역 = us - east - 1 # smtp 설정:

이메일 을 보 내 려 면 이메일 도 보 내야 합 니 다.

아마 존 에서 등록 하고 검사 해 야 하기 때 문 입 니 다.

(htps: / console. aws. amazon. com, / ses / 홈?지역 = us - east - 135; 보 낸 사람 이메일 확인:)

어떤 것 이 든 네가 나의 문 제 를 찾 을 수 있다.

나 는 내 가 도 울 수 있 기 를 바란다.

Comments