Hi I have 2 PHP codeigniter applications(app1,app2) in a server. Both application have email functions but I want to use two different address for sending out mail for each.
MY SETUP App1: uses SMTP Relay Server with IIS to send email with emailaddress1 -sending works fine. App2: I reconfigured my email class initialization to send with different email address without the use of smtp server - but this doesn't work..
I have already checked my password and my email and it works fine when signed in in office365
I have also checked my app1 smtp server queue,badmail,drop folder incase it's used by default bya app2 but still nothing.. no trace of the mail of app2.
Is it possible to use 2 different email address in one smtp server..anyone have tried this setup before?
/* app1 with smtp relay server*/
this->email->initialize(array(
'protocol' => 'smtp',
'mailtype' => 'html',
'smtp_host' => 'localhost',
'smtp_port' => 25,
'crlf' => "\r\n",
'newline' => "\r\n"
));
/*app2 without smtp server*/
$this->email->initialize(array(
'protocol' => 'smtp',
'mailtype' => 'html',
'smtp_host' => 'smtp.office365.com',
'smtp_port' => '587',
'smtp_user' => '[email protected]',
'smtp_pass' => 'mypassword',
'smtp_crypto' => 'tls',
'crlf' => "\r\n",
'newline' => "\r\n"
));
/*app2 issue no 1*/
unable to connect to smtp.office365.com:587 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)
/*app2 issue no 2*/
hello: 250-SG2PR01CA0107.outlook.office365.com Hello [122.52.203.168]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
starttls: 220 2.0.0 SMTP server ready
hello: 250-SG2PR01CA0107.outlook.office365.com Hello [122.52.203.168]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
Failed to authenticate password. Error: 535 5.7.3 Authentication unsuccessful [SG2PR01CA0107.apcprd01.prod.exchangelabs.com]
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method