Showing posts with label mail. Show all posts
Showing posts with label mail. Show all posts

Thursday, April 04, 2013

php: send email through gmail via mail

1. setup php and include mail:
this is how i did it on my linux box
# yum install php-pear
# pear install --alldeps Mail-1.2.0

2. to use mail in php:
// email settings
require_once "Mail.php";
$username = "<gmail email address here>@gmail.com";
$password = "<gmail email password here>";
$from = "<gmail email address here>@gmail.com";
$host = "ssl://smtp.gmail.com";
$port = "465";

$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject
);

$smtp = Mail::factory(
'smtp',
array(
'host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password
)
);

$mail = $smtp->send($to, $headers, $message);

if(PEAR::isError($mail))
{
$resultstring = "email sending error: " . $mail->getMessage();
}
else
{
$resultstring = "email sent to $to";
}

Tuesday, October 11, 2011

mail server: removal from spam database

check with

http://www.robtex.com

black list checker

use dnsstuff then follow delisting links
http://www.dnsstuff.com/

http://www.mxtoolbox.com/blacklists.aspx

http://www.au.sorbs.net/lookup.shtml

http://www.spamhaus.org/lookup.lasso

http://www.barracudanetworks.com/reputation/?pr=x.x.x.x

Tuesday, October 04, 2011

mail: clamav filling tmp directory

uninstalling and reinstalling clamav and simscan temporarily solves the issue xD
rpm -e simscan-toaster-x.x-x.x.x.x
rpm -e clamav-toaster-x.x.x-x.x.x
rpm -ivh /usr/src/redhat/RPMS/i386/clamav-toaster-x.x.x-x.x.x.x.rpm
rpm -ivh /usr/src/redhat/RPMS/i386/simscan-toaster-x.x-x.x.x.x.rpm

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...