473,587 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I Need Help in Using mail() Function!

Hello everybody,

When I send an email to any Hotmail account it goes directory to the
Junk Email!
My website is in a dedicated server using: Linux 2.4.21, Apa*che, PHP,
MySQL
I'm using the following function to send my emails:
=============== ===============
<?
function SendEmail($veFm Name, $veFmEmail, $veToName, $veToEmail,
$veSubj, $veBody) {
$bound="----=_NextPart_000_ " . uniqid(rand());
$message = "This is a multi-part message in MIME format.\r\n\r\n ";
// text
$message .= "--$bound\r\n";
$message .= "Content-Type: text/plain;
\r\n\tcharset=\ "windows-1256\"\r\n";
$message .= "Content-Transfer-Encoding: base64\r\n\r\n" ;
$message .= "This is an HTML email." . "\r\n\r\n";
// html
$message .= "--$bound\r\n";
$message .= "Content-Type: text/html;
\r\n\tcharset=\ "windows-1256\"\r\n";
$message .= "Content-Transfer-Encoding: quoted-printable\r\n\r \n";
$message .= $veBody;

$message .= "\r\n\r\n--$bound--";

$varHeader = "From: $veFmName <$veFmEmail>\r\ n";
$varHeader .= "Return-Path: $veFmEmail\r\n" ;
$varHeader .= "MIME-Version: 1.0\r\n";
$varHeader .= "Content-Type: multipart/alternative;
boundary=\"$bou nd\"\r\n";
//$varHeader .= "X-Mailer: PHP Mailer\r\n";
$varHeader .= "X-Mailer: Microsoft Office Outlook, Build
11.0.6353\r\n";
$varHeader .= "X-MimeOLE: Produced By Microsoft MimeOLE
V6.00.2900.2180 \r\n";
$varHeader .= $message;

return mail($veToEmail , $veSubj, "", $varHeader, "-f" . $veFmEmail);
}
// this is an example to use this function:
$varTitle = "Message Title Here";
$varBody = "The HTML body goes here.";
SendEmail("Send er Name", "My****@MyDomai n.com", "",
"An******@hotma il.com", $varTitle, $varBody);
?>
=============== ===============

Could you help me please!
Thanks.

Jul 17 '05 #1
4 1667
en********@gmai l.com hu kiteb:
Hello everybody,

When I send an email to any Hotmail account it goes directory to the
Junk Email!
My website is in a dedicated server using: Linux 2.4.21, Apa*che, PHP,
MySQL
I'm using the following function to send my emails:


Your time might be better spent persuading the people involved that you
aren't actually sending them junk mail. People have installed those spam
filters for a reason, and I don't think any responsible person would
post a way to get around those filters in a public forum.

Of course, if it is the case that you actually are sending junkmails
with php, can't help you there.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 17 '05 #2
en********@gmai l.com wrote:
Hello everybody,

When I send an email to any Hotmail account it goes directory to the
Junk Email!
My website is in a dedicated server using: Linux 2.4.21, Apa*che, PHP,
MySQL
I'm using the following function to send my emails:
=============== ===============
<?
function SendEmail($veFm Name, $veFmEmail, $veToName, $veToEmail,
$veSubj, $veBody) {
$bound="----=_NextPart_000_ " . uniqid(rand());
$message = "This is a multi-part message in MIME format.\r\n\r\n ";
// text
$message .= "--$bound\r\n";
$message .= "Content-Type: text/plain;
\r\n\tcharset=\ "windows-1256\"\r\n";
$message .= "Content-Transfer-Encoding: base64\r\n\r\n" ;
$message .= "This is an HTML email." . "\r\n\r\n";
// html
$message .= "--$bound\r\n";
$message .= "Content-Type: text/html;
\r\n\tcharset=\ "windows-1256\"\r\n";
$message .= "Content-Transfer-Encoding: quoted-printable\r\n\r \n";
$message .= $veBody;

$message .= "\r\n\r\n--$bound--";

$varHeader = "From: $veFmName <$veFmEmail>\r\ n";
$varHeader .= "Return-Path: $veFmEmail\r\n" ;
$varHeader .= "MIME-Version: 1.0\r\n";
$varHeader .= "Content-Type: multipart/alternative;
boundary=\"$bou nd\"\r\n";
//$varHeader .= "X-Mailer: PHP Mailer\r\n";
$varHeader .= "X-Mailer: Microsoft Office Outlook, Build
11.0.6353\r\n";
$varHeader .= "X-MimeOLE: Produced By Microsoft MimeOLE
V6.00.2900.2180 \r\n";
$varHeader .= $message;

return mail($veToEmail , $veSubj, "", $varHeader, "-f" . $veFmEmail);
}
// this is an example to use this function:
$varTitle = "Message Title Here";
$varBody = "The HTML body goes here.";
SendEmail("Send er Name", "My****@MyDomai n.com", "",
"An******@hotma il.com", $varTitle, $varBody);
?>
=============== ===============

Could you help me please!
Thanks.

1. Stop sending mail in html formats.
2. Stop pretending to be an email client that you're not.
3. Look at the headers you actually need, and send only those.
4. Start looking at the reasons why hotmail marks mail as spam.

Jul 17 '05 #3
en********@gmai l.com wrote:
Hello everybody,

When I send an email to any Hotmail account it goes directory to the
Junk Email!
My website is in a dedicated server using: Linux 2.4.21, Apa*che, PHP, MySQL
I'm using the following function to send my emails:

<snip code>

Try PHPMailer <http://phpmailer.sourc eforge.net/> instead. There are
more than one reasons for your mail to be trapped under junk mail. In
most of the cases I have had good results with PHPMailer. But, there
are certain cases, it won't work: 1. You're really sending junk mails,
2. You're not sending proper from/reply-to header, 3. You're domain or
email is blacklisted.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #4
Thanks for you all..

any other opinions..

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2251
by: Karuna | last post by:
Hi everybody, I have been trying to write a simple mail script using PHP and apache on Windows XP. Eventhough the script is saying that the mail is successfully sent, I am unable get it in my mailbox(I have given my mail address in $to). I am using the mail() function and I have made the following changes in php.ini ; For Win32 only....
9
1891
by: Jofio | last post by:
I am just learning PHP. I just tried coding a php script which I saved as mail.php ---------------------------- <? $name=$_POST; $email=$_POST; $comments=$_POST;
0
9864
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ********************************** package Celcom.Client;
4
2664
by: Duffey, Kevin | last post by:
I don't know if jdbc/java code requires this, but when I use two gui admin tools I found, and I insert a row into the table using their row editor feature, both require me to enter a number for the Serial type. I thought this type was used to auto-increment an id field and that I would not need to enter anything into it? Basically we need the...
3
1803
by: Martin | last post by:
Hi all, I have some VBScript code that I am trying to port over to VB.NET. I am receiving an error "Cast from type 'Field' to type 'String' is not valid." when calling the MapLegacyExchangeDN method. I'm thinking that the parameter sDirName isn't being properly passed to the function. The same code works in VBScript. Can someone help, this...
1
1640
by: Eric D. Nielsen | last post by:
I'm in the process of implementing a "monitor this" type feature on a web-application. When something changes on the monitored item an email to the subscriber is generated. I'd like to do this via triggers instead of application logic. As far as I can tell pl/pgsql does not include any method for e-mailing as a function side-effect. So I...
6
17159
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically, process and output to the screen in my application when a message arrived. But the problem is how do I read the SMS message immediately when it arrived...
7
7725
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee free edition for anti-virus. I use an ISP provider from my country and according to them I do not need to perform authentication while sending...
5
2998
by: GuangXiN | last post by:
I need an stmp client to send email through my mail server. I don't want to use php's mail function. who can recommend some?
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.