Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $from = "no-reply@mydomain.net";
- $port = "587";
- $to=$d_uname;
- $host = "smtp.sendgrid.net";
- $username = "username";
- $password = "password";
- $headers = array ('From' => $d_replyto,
- 'To' => $to,
- 'Subject' => $d_subject,
- 'MIME-Version' => "1.0",
- 'Content-type' => "text/plain; charset=utf-8",
- );
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'port' => $port,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
- #Email it
- if (PEAR::isError($smtp)) {
- error_log("<p>" . $smtp->getMessage() . "</p>");
- }
- $mail = $smtp->send($to, $headers, $d_message);
- authentication failure [SMTP: STARTTLS failed (code: 220, response: Begin TLS negotiation now)]
- else{ // if $fp does exist
- stream_context_set_option($fp, 'ssl', 'verify_peer', false);
- stream_context_set_option($fp, 'ssl', 'allow_self_signed', true);
- stream_context_set_option($fp, 'ssl', 'verify_peer_name', false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement