Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send mail issue in SnipeIt #802

Closed
enagamani opened this issue May 18, 2015 · 23 comments
Closed

Send mail issue in SnipeIt #802

enagamani opened this issue May 18, 2015 · 23 comments

Comments

@enagamani
Copy link

I am using the snipe IT in windows 2008 R2 server and I don't have the send mail in my server. I am using the SMTP drivers in snipe It. But I am unable to send the mails. I am getting the below error every time I try open a page using the mail option.

Ouch.

Server Error: 500 (Internal Server Error)

What does this mean?

Something went wrong on our servers while we were processing your request. We're really sorry about this, and will work hard to get this resolved as soon as possible.

Perhaps you would like to go to our home page?

Could some on help to solve this issue?

@snipe
Copy link
Owner

snipe commented May 18, 2015

Can you tell me what's in your logs?

@enagamani
Copy link
Author

Hi,

I am new to the Snipe-IT app. Could you tell me how to view the log?

@shafrax
Copy link

shafrax commented May 19, 2015

i am having same problem. when i use Gmail SMTP setting it work. but when i use my office SMTP setting it shows the error.

here is what log show

[2015-05-19 04:56:18] production.ERROR: exception 'ErrorException' with message 'stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed' in C:\inetpub\wwwroot\snipe-it\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php:95

@snipe
Copy link
Owner

snipe commented May 21, 2015

@shafrax can you show me your mail.php settings (without the actual email address and password, of course)

@enagamani
Copy link
Author

Hi,

I have attached the mail.php file for your reference. The file is placed under “inetpub\wwwroot\snipe-it\app\config”

Thanks & Regards,

Nagamani E | Cenza Technologies Pvt Ltd | #4, Industrial Estate, Perungudi, Chennai – 600 096 | Tel: +91 44 24960050/38 | Fax: +91 44 24960032 | Mail: systemadmin@cenzatech.com | Website: www.cenzatech.com http://www.cenzatech.com/

CONFIDENTIALITY NOTICE: This E-mail and any attachments are confidential and may be protected by legal privilege. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this E-mail or any attachment is prohibited. If you have received this E-mail in error, please notify us immediately on +91 44 24960038/50 or by email and delete this copy from your system. Thank you for your cooperation.

P Please do not print this email unless it is absolutely necessary. Save paper. Save trees. Spread environmental awareness

From: snipe [mailto:notifications@github.com]
Sent: Friday, May 22, 2015 01:38
To: snipe/snipe-it
Cc: enagamani
Subject: Re: [snipe-it] Send mail issue in SnipeIt (#802)

@shafrax https://github.com/shafrax can you show me your mail.php settings (without the actual email address and password, of course)


Reply to this email directly or view it on GitHub #802 (comment) . https://github.com/notifications/beacon/ALZzzYFN7XG_rSegJB7YTUFfpS3U3W5uks5oLjKigaJpZM4Eejcl.gif

@snipe
Copy link
Owner

snipe commented May 22, 2015

@enagamani You can't send attachments through GH issues. You'll have to copy+paste it into the web form on Github.

@enagamani
Copy link
Author

enagamani commented May 23, 2015

Hi,

I have pasted the configuration file below.

<?php

return array(

/*

|--------------------------------------------------------------------------

| Mail Driver

|--------------------------------------------------------------------------

|

| Laravel supports both SMTP and PHP's "mail" function as drivers for the

| sending of e-mail. You may specify which one you're using throughout

| your application here. By default, Laravel is setup for SMTP mail.

|

| Supported: "smtp", "mail", "sendmail"

|

*/



'driver' => 'smtp',



/*

|--------------------------------------------------------------------------

| SMTP Host Address

|--------------------------------------------------------------------------

|

| Here you may provide the host address of the SMTP server used by your

| applications. A default option is provided that is compatible with

| the Postmark mail service, which will provide reliable delivery.

|

*/



'host' => '192.168.2.4',



/*

|--------------------------------------------------------------------------

| SMTP Host Port

|--------------------------------------------------------------------------

|

| This is the SMTP port used by your application to delivery e-mails to

| users of your application. Like the host we have set this value to

| stay compatible with the Postmark e-mail application by default.

|

*/



'port' => 25,



/*

|--------------------------------------------------------------------------

| Global "From" Address

|--------------------------------------------------------------------------

|

| You may wish for all e-mails sent by your application to be sent from

| the same address. Here, you may specify a name and address that is

| used globally for all e-mails that are sent by your application.

|

*/



'from' => array('address' => Sniptit@XXXXXX.com, 'name' => Snipeit),



/*

|--------------------------------------------------------------------------

| E-Mail Encryption Protocol

|--------------------------------------------------------------------------

|

| Here you may specify the encryption protocol that should be used when

| the application send e-mail messages. A sensible default using the

| transport layer security protocol should provide great security.

|

*/



'encryption' => 'null',



/*

|--------------------------------------------------------------------------

| SMTP Server Username

|--------------------------------------------------------------------------

|

| If your SMTP server requires a username for authentication, you should

| set it here. This will get used to authenticate with your server on

| connection. You may also set the "password" value below this one.

|

*/



'username' => XXXXXXX,



/*

|--------------------------------------------------------------------------

| SMTP Server Password

|--------------------------------------------------------------------------

|

| Here you may set the password required by your SMTP server to send out

| messages from your application. This will be given to the server on

| connection so that the application will be able to send messages.

|

*/



'password' => XXXXXXX,



/*

|--------------------------------------------------------------------------

| Sendmail System Path

|--------------------------------------------------------------------------

|

| When using the "sendmail" driver to send e-mails, we will need to know

| the path to where Sendmail lives on this server. A default path has

| been provided here, which will work well on most of your systems.

|

*/



'sendmail' => '/usr/sbin/sendmail -bs',



/*

|--------------------------------------------------------------------------

| Mail "Pretend"

|--------------------------------------------------------------------------

|

| When this option is enabled, e-mail will not actually be sent over the

| web and will instead be written to your application's logs files so

| you may inspect the message. This is great for local development.

|

*/



'pretend' => false,

);

Thanks & Regards,

Nagamani E | Cenza Technologies Pvt Ltd | #4, Industrial Estate, Perungudi, Chennai – 600 096 | Tel: +91 44 24960050/38 | Fax: +91 44 24960032 | Mail: systemadmin@cenzatech.com | Website: www.cenzatech.com http://www.cenzatech.com/

CONFIDENTIALITY NOTICE: This E-mail and any attachments are confidential and may be protected by legal privilege. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this E-mail or any attachment is prohibited. If you have received this E-mail in error, please notify us immediately on +91 44 24960038/50 or by email and delete this copy from your system. Thank you for your cooperation.

@snipe
Copy link
Owner

snipe commented May 23, 2015

@enagamani I think you need to use a named mail server, since it's looking for an SSL certificate. Something like mail.yourserver.com

@enagamani
Copy link
Author

Hi,

My mail server doesn’t require SSL certificate to send the mails. Also I change the configuration as below. Still the problem exists.

'smtp', /* |-------------------------------------------------------------------------- | SMTP Host Address |-------------------------------------------------------------------------- | | Here you may provide the host address of the SMTP server used by your | applications. A default option is provided that is compatible with | the Postmark mail service, which will provide reliable delivery. | */ 'host' => 'censun.cenzaa.com', /* |-------------------------------------------------------------------------- | SMTP Host Port |-------------------------------------------------------------------------- | | This is the SMTP port used by your application to delivery e-mails to | users of your application. Like the host we have set this value to | stay compatible with the Postmark e-mail application by default. | */ 'port' => 25, /* |-------------------------------------------------------------------------- | Global "From" Address |-------------------------------------------------------------------------- | | You may wish for all e-mails sent by your application to be sent from | the same address. Here, you may specify a name and address that is | used globally for all e-mails that are sent by your application. | */ 'from' => array('address' => Sniptit@cenzaa.com, 'name' => Snipeit), /* |-------------------------------------------------------------------------- | E-Mail Encryption Protocol |-------------------------------------------------------------------------- | | Here you may specify the encryption protocol that should be used when | the application send e-mail messages. A sensible default using the | transport layer security protocol should provide great security. | */ 'encryption' => 'null', /* |-------------------------------------------------------------------------- | SMTP Server Username |-------------------------------------------------------------------------- | | If your SMTP server requires a username for authentication, you should | set it here. This will get used to authenticate with your server on | connection. You may also set the "password" value below this one. | */ 'username' => XXXXXXX, /* |-------------------------------------------------------------------------- | SMTP Server Password |-------------------------------------------------------------------------- | | Here you may set the password required by your SMTP server to send out | messages from your application. This will be given to the server on | connection so that the application will be able to send messages. | */ 'password' => XXXXXXX, /* |-------------------------------------------------------------------------- | Sendmail System Path |-------------------------------------------------------------------------- | | When using the "sendmail" driver to send e-mails, we will need to know | the path to where Sendmail lives on this server. A default path has | been provided here, which will work well on most of your systems. | */ 'sendmail' => '/usr/sbin/sendmail -bs', /* |-------------------------------------------------------------------------- | Mail "Pretend" |-------------------------------------------------------------------------- | | When this option is enabled, e-mail will not actually be sent over the | web and will instead be written to your application's logs files so | you may inspect the message. This is great for local development. | */ 'pretend' => false, ``` ); Thanks & Regards, Nagamani E | Cenza Technologies Pvt Ltd | #4, Industrial Estate, Perungudi, Chennai – 600 096 | Tel: +91 44 24960050/38 | Fax: +91 44 24960032 | Mail: systemadmin@cenzatech.com | Website: www.cenzatech.com http://www.cenzatech.com/ CONFIDENTIALITY NOTICE: This E-mail and any attachments are confidential and may be protected by legal privilege. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this E-mail or any attachment is prohibited. If you have received this E-mail in error, please notify us immediately on +91 44 24960038/50 or by email and delete this copy from your system. Thank you for your cooperation. P Please do not print this email unless it is absolutely necessary. Save paper. Save trees. Spread environmental awareness From: snipe [mailto:notifications@github.com] Sent: Saturday, May 23, 2015 08:22 To: snipe/snipe-it Cc: enagamani Subject: Re: [snipe-it] Send mail issue in SnipeIt (#802) @enagamani https://github.com/enagamani I think you need to use a named mail server, since it's looking for an SSL certificate. Something like mail.yourserver.com — Reply to this email directly or view it on GitHub https://github.com//issues/802#issuecomment-104822588 . https://github.com/notifications/beacon/ALZzzfFK8eIQWtQki56i-8JN8pAY2wcDks5oL-LIgaJpZM4Eejcl.gif

@uberbrady
Copy link
Collaborator

That's weird, your configuration looks fine.

Here, maybe you can try this?

on your webserver, install the telnet client. I think this is part of the add/remove components, but I haven't used Windows in a while so I can't be sure.

From your webserver try:

telnet 192.168.2.4 25

The result you should get from that is an SMTP banner or greeting. If you get absolutely nothing, then it's possible you're dealing with a networking issue between your webserver and mailserver.

Let us know what you find.

@shafrax
Copy link

shafrax commented May 24, 2015

@snipe this is my mail.php setting.

'smtp', /* |-------------------------------------------------------------------------- | SMTP Host Address |-------------------------------------------------------------------------- | | Here you may provide the host address of the SMTP server used by your | applications. A default option is provided that is compatible with | the Postmark mail service, which will provide reliable delivery. | */ 'host' => 'mail.mydomain.com', /* |-------------------------------------------------------------------------- | SMTP Host Port |-------------------------------------------------------------------------- | | This is the SMTP port used by your application to delivery e-mails to | users of your application. Like the host we have set this value to | stay compatible with the Postmark e-mail application by default. | */ 'port' => 587, /* |-------------------------------------------------------------------------- | Global "From" Address |-------------------------------------------------------------------------- | | You may wish for all e-mails sent by your application to be sent from | the same address. Here, you may specify a name and address that is | used globally for all e-mails that are sent by your application. | */ 'from' => array('address' => null, 'name' => null), /* |-------------------------------------------------------------------------- | E-Mail Encryption Protocol |-------------------------------------------------------------------------- | | Here you may specify the encryption protocol that should be used when | the application send e-mail messages. A sensible default using the | transport layer security protocol should provide great security. | */ 'encryption' => 'TLS', /* |-------------------------------------------------------------------------- | SMTP Server Username |-------------------------------------------------------------------------- | | If your SMTP server requires a username for authentication, you should | set it here. This will get used to authenticate with your server on | connection. You may also set the "password" value below this one. | */ 'username' => 'shafrax@mydomain.com', /* |-------------------------------------------------------------------------- | SMTP Server Password |-------------------------------------------------------------------------- | | Here you may set the password required by your SMTP server to send out | messages from your application. This will be given to the server on | connection so that the application will be able to send messages. | */ 'password' => '**********', /* |-------------------------------------------------------------------------- | Sendmail System Path |-------------------------------------------------------------------------- | | When using the "sendmail" driver to send e-mails, we will need to know | the path to where Sendmail lives on this server. A default path has | been provided here, which will work well on most of your systems. | */ 'sendmail' => '/usr/sbin/sendmail -bs', /* |-------------------------------------------------------------------------- | Mail "Pretend" |-------------------------------------------------------------------------- | | When this option is enabled, e-mail will not actually be sent over the | web and will instead be written to your application's logs files so | you may inspect the message. This is great for local development. | */ 'pretend' => false, ``` );

@snipe
Copy link
Owner

snipe commented May 24, 2015

@shafrax you need to fill out the from settings

@shafrax
Copy link

shafrax commented May 25, 2015

@snipe i filled from setting but not working.

this is what log shows.

[2015-05-25 03:59:43] production.ERROR: exception 'ErrorException' with message 'stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed' in C:\inetpub\wwwroot\snipe-it\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php:95
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'stream_socket_e...', 'C:\inetpub\wwwr...', 95, Array)
#1 C:\inetpub\wwwroot\snipe-it\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php(95): stream_socket_enable_crypto(Resource id #229, true, 57)
#2 C:\inetpub\wwwroot\snipe-it\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\EsmtpTransport.php(288): Swift_Transport_StreamBuffer->startTLS()
#3 C:\inetpub\wwwroot\snipe-it\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(118): Swift_Transport_EsmtpTransport->_doHeloCommand()
#4 C:\inetpub\wwwroot\snipe-it\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start()
#5 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Mail\Mailer.php(329): Swift_Mailer->send(Object(Swift_Message), Array)
#6 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Mail\Mailer.php(151): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))
#7 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(3271): Illuminate\Mail\Mailer->send('emails.forgot-p...', Array, Object(Closure))
#8 C:\inetpub\wwwroot\snipe-it\app\controllers\AuthController.php(221): Illuminate\Support\Facades\Facade::__callStatic('send', Array)
#9 C:\inetpub\wwwroot\snipe-it\app\controllers\AuthController.php(221): Illuminate\Support\Facades\Mail::send('emails.forgot-p...', Array, Object(Closure))
#10 [internal function]: AuthController->postForgotPassword()
#11 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(231): call_user_func_array(Array, Array)
#12 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5847): Illuminate\Routing\Controller->callAction('postForgotPassw...', Array)
#13 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5835): Illuminate\Routing\ControllerDispatcher->call(Object(AuthController), Object(Illuminate\Routing\Route), 'postForgotPassw...')
#14 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5040): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'AuthController', 'postForgotPassw...')
#15 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}()
#16 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5398): call_user_func_array(Object(Closure), Array)
#17 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5065): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#18 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(5053): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#19 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(715): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#20 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(696): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#21 C:\inetpub\wwwroot\snipe-it\vendor\barryvdh\laravel-debugbar\src\Middleware\Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#22 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(7825): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true)
#23 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(8432): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#24 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(8379): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#25 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(11045): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#26 C:\inetpub\wwwroot\snipe-it\bootstrap\compiled.php(657): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#27 C:\inetpub\wwwroot\snipe-it\public\index.php(49): Illuminate\Foundation\Application->run()
#28 {main} [] []

@enagamani
Copy link
Author

Hi,

I filled the from settings. But still I have the same problem. I getting the below error in the log file.

[2015-05-25 05:20:34] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'syntax error, unexpected '@', expecting ')'' in C:\inetpub\wwwroot\snipe-it\app\config\mail.php:57

Stack trace:

#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()

#1 {main} [] []

Thanks & Regards,

Nagamani E | Cenza Technologies Pvt Ltd | #4, Industrial Estate, Perungudi, Chennai – 600 096 | Tel: +91 44 24960050/38 | Fax: +91 44 24960032 | Mail: systemadmin@cenzatech.com | Website: www.cenzatech.com http://www.cenzatech.com/

CONFIDENTIALITY NOTICE: This E-mail and any attachments are confidential and may be protected by legal privilege. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this E-mail or any attachment is prohibited. If you have received this E-mail in error, please notify us immediately on +91 44 24960038/50 or by email and delete this copy from your system. Thank you for your cooperation.

P Please do not print this email unless it is absolutely necessary. Save paper. Save trees. Spread environmental awareness

From: snipe [mailto:notifications@github.com]
Sent: Sunday, May 24, 2015 23:24
To: snipe/snipe-it
Cc: enagamani
Subject: Re: [snipe-it] Send mail issue in SnipeIt (#802)

@shafrax https://github.com/shafrax you need to fill out the from settings


Reply to this email directly or view it on GitHub #802 (comment) . https://github.com/notifications/beacon/ALZzzRsD-r7H06-zjCNICIZCSExLVtYIks5oMgefgaJpZM4Eejcl.gif

@snipe
Copy link
Owner

snipe commented May 27, 2015

@enagamani it looks like you have a typo in your from address:

'from' => array('address' => Sniptit@cenzaa.com, 'name' => Snipeit),

Missing single quotes around the values. Should be:

'from' => array('address' => 'Sniptit@cenzaa.com', 'name' => 'Snipeit'),

@snipe snipe closed this as completed May 27, 2015
@ghost
Copy link

ghost commented Sep 11, 2015

Hello , im still trying to get email up and running with no luck. using exchange smtp address no authentication required at all. any help will be appreciated

i get this on the page Server Error: 500 (Internal Server Error) when trying to using forgot my password

and this is what i see in the logs.

[Fri Sep 11 07:56:12.710920 2015] [:error] [pid 8499] [client xxx.xxxx.xxxx.xxxx:57629] PHP Parse error: syntax error, unexpected '{' in /var/www/snipe-it-develop/app/config/mail.php on line 44, referer: http://xxx.xxx.xxx.xxx/auth/forgot-password

and here is mail.php config

<?php

return array(

/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/

'driver' => 'smtp',

/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/

'host' => '{{10.0.0.257}}',

/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/

'port' => 25,

/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/

'from' => array('snipe-it@mydomain.com' => null, 'snipeit' => null),

/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/

'encryption' => null,

/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/

'username' => null,

/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/

'password' => null,

/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/

'sendmail' => '/usr/sbin/sendmail -bs',

/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/

'pretend' => false,

 );

@ddreier
Copy link

ddreier commented Sep 11, 2015

Your host IP should not be wrapped in {{ }}.

@snipe
Copy link
Owner

snipe commented Sep 11, 2015

@ddreier is correct. Values in the config should be in single quotes, never braces

@devilsoulblack
Copy link

devilsoulblack commented Feb 6, 2016

@snipe i have issue with send email

i get this logs

[2016-02-06 01:54:21] production.ERROR: exception 'Swift_TransportException' with message 'Expected response code 220 but got code "", with message "+OK Dovecot ready. "' in /var/www/snipeit/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383 Stack trace: #0 /var/www/snipeit/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(289): Swift_Transport_AbstractSmtpTransport->_assertResponseCode('+OK Dovecot rea...', Array) #1 /var/www/snipeit/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(117): Swift_Transport_AbstractSmtpTransport->_readGreeting() #2 /var/www/snipeit/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start() #3 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(329): Swift_Mailer->send(Object(Swift_Message), Array) #4 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(151): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message)) #5 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(214): Illuminate\Mail\Mailer->send('emails.forgot-p...', Array, Object(Closure)) #6 /var/www/snipeit/app/controllers/AuthController.php(331): Illuminate\Support\Facades\Facade::__callStatic('send', Array) #7 /var/www/snipeit/app/controllers/AuthController.php(331): Illuminate\Support\Facades\Mail::send('emails.forgot-p...', Array, Object(Closure)) #8 [internal function]: AuthController->postForgotPassword() #9 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(231): call_user_func_array(Array, Array) #10 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(93): Illuminate\Routing\Controller->callAction('postForgotPassw...', Array) #11 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(62): Illuminate\Routing\ControllerDispatcher->call(Object(AuthController), Object(Illuminate\Routing\Route), 'postForgotPassw...') #12 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Router.php(967): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'AuthController', 'postForgotPassw...') #13 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}() #14 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array(Object(Closure), Array) #15 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1033): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) #16 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1001): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #17 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #18 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request)) #19 /var/www/snipeit/vendor/barryvdh/laravel-debugbar/src/Middleware/Stack.php(34): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true) #20 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Barryvdh\Debugbar\Middleware\Stack->handle(Object(Illuminate\Http\Request), 1, true) #21 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true) #22 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true) #23 /var/www/snipeit/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true) #24 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request)) #25 /var/www/snipeit/public/index.php(49): Illuminate\Foundation\Application->run() #26 {main} [] []

this is my mail.php

<?php

return array(

/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/

'driver' => 'smtp',

/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/

'host' => 'mail.altsolutions.cl',

/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/

'port' => '110',

/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/

'from' => array('address' => 'snipeit@altsolutions.cl', 'name' => 'Snipeit'),

/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/

'encryption' => null,

/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/

'username' => 'snipeit@altsolutions.cl',

/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/

'password' => 'PASSWORD',

/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/

'sendmail' => '/usr/sbin/sendmail -bs',

/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/

'pretend' => false,


);`

any idea what is wrong ?

@Sathish5470
Copy link

Sathish5470 commented May 18, 2017

Hi Snipe-it,

I also had same problem, but couldn't able to fix it please help me this.

<?php

return array(

    /*
    |--------------------------------------------------------------------------
    | Mail Driver
    |--------------------------------------------------------------------------
    |
    | Laravel supports both SMTP and PHP's "mail" function as drivers for the
    | sending of e-mail. You may specify which one you're using throughout
    | your application here. By default, Laravel is setup for SMTP mail.
    |
    | Supported: "smtp", "mail", "sendmail"
    |
    */

    'driver' => 'smtp',

    /*
    |--------------------------------------------------------------------------
    | SMTP Host Address
    |--------------------------------------------------------------------------
    |
    | Here you may provide the host address of the SMTP server used by your
    | applications. A default option is provided that is compatible with
    | the Postmark mail service, which will provide reliable delivery.
    |
    */

    'host' => 'smtp.gmail.com',

    /*
    |--------------------------------------------------------------------------
    | SMTP Host Port
    |--------------------------------------------------------------------------
    |
    | This is the SMTP port used by your application to delivery e-mails to
    | users of your application. Like the host we have set this value to
    | stay compatible with the Postmark e-mail application by default.
    |
    */

    'port' => 465,

    /*
    |--------------------------------------------------------------------------
    | Global "From" Address
    |--------------------------------------------------------------------------
    |
    | You may wish for all e-mails sent by your application to be sent from
    | the same address. Here, you may specify a name and address that is
    | used globally for all e-mails that are sent by your application.
    |
    */

    'from' => array('address' => 'sathishkumar@gmail.com', 'name' => 'Sathish Kumar'),

    /*
    |--------------------------------------------------------------------------
    | E-Mail Encryption Protocol
    |--------------------------------------------------------------------------
    |
    | Here you may specify the encryption protocol that should be used when
    | the application send e-mail messages. A sensible default using the
    | transport layer security protocol should provide great security.
    |
    */

    'encryption' => 'ssl',

    /*
    |--------------------------------------------------------------------------
    | SMTP Server Username
    |--------------------------------------------------------------------------
    |
    | If your SMTP server requires a username for authentication, you should
    | set it here. This will get used to authenticate with your server on
    | connection. You may also set the "password" value below this one.
    |
    */

    'username' => 'sathishkumar@gmail.com',

    /*
    |--------------------------------------------------------------------------
    | SMTP Server Password
    |--------------------------------------------------------------------------
    |
    | Here you may set the password required by your SMTP server to send out
    | messages from your application. This will be given to the server on
    | connection so that the application will be able to send messages.
    |
    */

    'password' => 'XXXXXXXX',
	
	

    /*
    |--------------------------------------------------------------------------
    | Sendmail System Path
    |--------------------------------------------------------------------------
    |
    | When using the "sendmail" driver to send e-mails, we will need to know
    | the path to where Sendmail lives on this server. A default path has
    | been provided here, which will work well on most of your systems.
    |
    */

    'sendmail' => '/usr/sbin/sendmail -bs',

    /*
    |--------------------------------------------------------------------------
    | Mail "Pretend"
    |--------------------------------------------------------------------------
    |
    | When this option is enabled, e-mail will not actually be sent over the
    | web and will instead be written to your application's logs files so
    | you may inspect the message. This is great for local development.
    |
    */

    'pretend' => false,

);

@snipe
Copy link
Owner

snipe commented May 19, 2017

@Sathish5470 what version of Snipe-IT are you using?

@Sathish5470
Copy link

v2.1.0-47-g39f40a3

@Sathish5470
Copy link

Hi Team,

Can you please help me to fix my mail send issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants