无法在godaddy托管上发送来自Laravel 4的邮件

问题描述 投票:2回答:1

我使用以下代码使用Laravel 4发送电子邮件。

Mail::send('emails.welcome', array('data' => 'This is a test content' ), function($message)
{
    $message->to('[email protected]', 'TomTom')->subject('Welcome to Laravel!');
});

每当我尝试发送电子邮件时,它都会引发以下错误:

A connection could not be established with the host 
smtpout.asia.secureserver.net [Connection refused #111]

但是当我使用php邮件功能发送电子邮件时,它工作正常!

var_dump(mail("[email protected]", "subject", "hello world"));

那有什么问题呢?

php email laravel-4 swiftmailer
1个回答
0
投票

你可以尝试另一个端口:

return array(    
    'driver' => 'smtp',
    'host' => 'ailstore1.asia.secureserver.net',
    'port' => 465,
    'from' => array('address' => '[email protected]', 'name' => 'name'),
    'encryption' => 'ssl',   
    'username' => '',    
    'password' => '',
    'sendmail' => '/usr/sbin/sendmail -bs',
    'pretend' => false
);
© www.soinside.com 2019 - 2024. All rights reserved.