Email not sending to Hotmail


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Email not sending to Hotmail
# 1  
Old 05-09-2008
Email not sending to Hotmail

I have a strange problem. I have a script that sends out emails and it used to work fine to all email addresses, but I recently moved the site to a dedicated server and now it won't send out emails to any Hotmail accounts. None of the Hotmail accounts have got spam filters on and they all used to get email from the site. All of the script is the same as I say the only difference is the site is now on a dedicated server. Both the old and new servers are RedHat Linux using php5. I went into the php.ini file and all I found for SMTP is:

Quote:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
The send_mail() function is:

Code:
<?php

function send_mail($to, $from, $subject, $message)
{
	global $g;
	if (isset($g['options']['mail_html']) and $g['options']['mail_html'] == "Y") $ct = "text/html";
	else $ct = "text/plain";
	if (isset($g['options']['mail_utf8']) and $g['options']['mail_utf8'] == "Y") {
		$headers = "From: " . $from . "\n";
		$headers .= "Content-Type: " . $ct . "; charset=utf-8;\n";
		$headers .= "Reply-To: " . $from . ";\n";
		$headers .= "Return-Path: " . $from . ";\n";
	} else {
		$headers = "From: " . $from . "\n";
		$headers .= "Content-Type: " . $ct . ";\n";
		$headers .= "Reply-To: " . $from . ";\n";
		$headers .= "Return-Path: " . $from . ";\n";		
	}
	if (isset($g['options']['mail_utf8_subject']) and $g['options']['mail_utf8_subject'] == "Y") $subject = '=?UTF-8?B?'.base64_encode(trim(preg_replace('#[\n\r]+#s', '', $subject)))."?=\n";
	mail($to, $subject, $message, $headers);
}

but that all works fine. It's just that the emails aren't being sent to Hotmail addresses.
# 2  
Old 05-09-2008
maybe your new server dunno how to forward the email, maybe you need to specify a mailhost or maybe some config missing.

Go to the "/" root filesystem and check if there is any file called dead.letter.

type mailq to check if your mails are stuck in the queue.

on solaris servers there is a syslog log file whenever you send email out it will log to that file, check your syslog for more clues. Maybe syslog will say mails are dererred or error or remote server terminated you.

Lastly you can try few things which can reveal more details on what's going on in the email sending process

banner test > /tmp/xxx
/usr/lib/sendmail -v youremail@hotmail.com < /tmp/xxx

or

(assuming from your above code your localhost is your mailhost)

First open 2 sessions.
1st session do a tail -f /var/log/syslog

2nd session do
telnet localhost 25
mail from: darthvader@yourdomain.com
rcpt to: youremail@hotmail.com
data
test
test
test
. <---- once you type the termination "." it will immed attempt to send the email. Then at the same time switch to first session(tail -f) to check syslog and see what it says.
# 3  
Old 05-09-2008
but if you just want a quick and dirty way out of your problem. This may or may not work (usually it does work for me)

On the new server stop sendmail then backup sendmail binary and sendmail.cf
cp -p sendmail sendmail.ORG
cp -p sendmail.cf sendmailcf.ORG

from your old server copy over the sendmail binary and cf file into the appropriate directory, change the appropriate ownership and permissions then start sendmail. Check syslog (tail -f) to see if mails are going out.

good luck
# 4  
Old 05-12-2008
Thanks, the server itself is sending out email, it was just Hotmail that wasn't getting through, but it turned out that Spam Cannibal had wrong blacklisted it. I've now had it removed from the list and it's all working fine.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Sending an email using mutt...

I wanted to send "config.log" to the usergroup that handles open source support for Octave 3.8.0, a programming language as there were build errors. In order to send an email from unix command line, I am trying to use mutt, and I need a straightforward way of sending emails, as the commands... (1 Reply)
Discussion started by: jon80
1 Replies

2. Shell Programming and Scripting

Sending HTML Email

1) Can you please provide me with a best example of how to send an HTML email via mutt or mail or send email commands using bash shell. 2) I tried below but i am not able to get the variable values in the HTML email output. (cat <<-EOT <html> <head><title></title> </head> <body> <p>Hello,... (9 Replies)
Discussion started by: Ariean
9 Replies

3. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

4. Linux

sending an email

I have used an already-built ActiveX control to send email from my asp web pages. One of the parameters I fill is FromName which defines the tittle the recipient will see in the From entrance in his Inbox. Now Iīm trying to use mail to send an email from a Shell but I havenīt found the... (1 Reply)
Discussion started by: RandomAccess
1 Replies

5. Shell Programming and Scripting

Sending Email with Attachment

Hi, I want to send an email with multiple attachment using uuencode and mail command. I am able to send with one attachment Ex:uuencode abc.txt abc.txt | mail test@test.com -s "Test3" Can anyone reply with syntax. Regards BS (3 Replies)
Discussion started by: balajiora
3 Replies

6. UNIX for Dummies Questions & Answers

Sending email attachments

Hello, I've search the forum, but I cannot find an answer to my specific question. I'm trying to send some files to my professor. Upon his request, I used the following: tar -cvf vh.tar vh_part1.c vh_part2.c vh_part3.c vh_part4.c vh_sample_run15.txt uuencode vh.tar vh.tar > proj1 mail... (2 Replies)
Discussion started by: venush
2 Replies

7. Shell Programming and Scripting

Sending an email with more than one files

Hi, I would like to send an email with more than one attachement. I am using uuencode. I want to achive by suing uuencode. Also please let me know other ways. -Thambi (7 Replies)
Discussion started by: thambi
7 Replies

8. UNIX for Dummies Questions & Answers

sending email

hi, is there any possiblity to send email from the command prompt, for eg i want to send alert to any mail id like /data/logs is 80% to my hotmail account , xxx@hotmail.com is this really possible,, if not, then what are the prerequistes need to do this (1 Reply)
Discussion started by: vasikaran
1 Replies

9. UNIX for Dummies Questions & Answers

Sending email

I have an Solaris 8 machine running a managment application. One of the features of this application is to configure alarm forwarding to an email undress. When i configured the application to do that, it asked me only about the recipient email address. Quesiton: how to configure my Solaris 8... (7 Replies)
Discussion started by: bcheaib
7 Replies

10. UNIX for Dummies Questions & Answers

sending email from mailx

hi can i know how to use mailx to send email to my lotus email account? i wan to send a file in a directory as an attachment and then email to lotus. can show me the command line to do it? thanks a lot (1 Reply)
Discussion started by: legato
1 Replies
Login or Register to Ask a Question