Page 1 of 1

Mail not sending

Posted: Sat Dec 28, 2019 6:59 am
by rajatvarshney
Hello vesta community,

I have researched a lot on forums or on the web but nothing is working i am not able to send an email with SMTP settings, without the SMTP settings it's going to spam.
I am using Codeigniter framework,

Code that worked (without SMTP)

/////////////But this is going in SPAM/////////////

$this->load->library('email');
$this->email->from("[email protected]");
$this->email->to("[email protected]");
$this->email->subject("test email");
$this->email->message("test");
if ($this->email->send()) {
echo 'Your Email has successfully been sent.';
} else {
show_error($this->email->print_debugger());
}

/////////////But this is going in SPAM/////////////

After that, I have created an email account for one of my domain and with its smtp settings:

Username:[email protected]
Password:7QD4GzSDKc
SMTP hostname:mediabharti.org
SMTP port:587
SMTP security:STARTTLS

//// Code With SMTP///

$this->load->library('email');
$config = array();
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'mediabharti.org';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = '7QD4GzSDKc';
$config['smtp_port'] = 25;
$this->email->initialize($config);
$this->email->set_newline("\r\n");



$this->email->from("[email protected]");
$this->email->to("[email protected]");
$this->email->subject("test email");
$this->email->message("test");

if ($this->email->send()) {
echo 'Your Email has successfully been sent.';
} else {
show_error($this->email->print_debugger());
}

//////////


But Its throwing Error:

A PHP Error was encountered
Severity: Warning

Message: fsockopen(): unable to connect to mediabharti.org:25 (Connection timed out)

Filename: libraries/Email.php

Line Number: 2055

Backtrace:

File: /home/medbha/web/english.mediabharti.net/public_html/application/controllers/Home.php
Line: 48
Function: send

File: /home/medbha/web/english.mediabharti.net/public_html/index.php
Line: 315
Function: require_once



//////

Please Somebody Help!!!

Re: Mail not sending

Posted: Wed Jan 01, 2020 9:00 pm
by skamasle
Hi

If mail go to spam, isnt a vesta problem, maybe your IP reputation is bad, or you not have setup property some records like SPF; DKIM or any orther