473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

mail() Getting An Email To Go Through

I'm messing with the mail() function trying to get some email
through.

I managed to get the email through yesterday, and perhaps
the mail server is slow delivering.

function SendSomeEmailOut() {
// bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
$sToAddr = "so*****@example.com";
$sFromAddr = "Some One Else <'s**********@example.com'>";
$sEmailSubject = "Sample Subject";
$sEmailBody = "Sample Body";
$yResults = mail($sToAddr, $sEmailSubject, $sEmailBody, $sFromAddr);
return($yResults);
}

$yResults always comes back as true.

Any suggestions are greatly appreciated. Thanks.

--
Jim Carlock
Post replies to the group.

Sep 3 '06 #1
1 1035
Jim Carlock wrote:
I'm messing with the mail() function trying to get some email through.

I managed to get the email through yesterday, and perhaps the mail server
is slow delivering.

$sFromAddr = "Some One Else <'s**********@example.com'>";

$yResults = mail($sToAddr, $sEmailSubject, $sEmailBody, $sFromAddr);
Your "From" header is malformed. In fact, it's really not a header at all;
the line looks like this:

Some One Else <'s**********@example.com'>

when it should look like this:

From: Some One Else <so*********@example.com>

So, basically, you need to add the "From: " and take the single quotes out
of the e-mail address. I'm not sure whether this will solve your problem,
but it could certainly be creating issues.

HTH,
--
Benjamin D. Esham
bd*****@gmail.com | AIM: bdesham128 | Jabber: same as e-mail
"Anyone entrusted with power will abuse it if not also animated
with the love of truth and virtue, no matter whether he be a
prince, or one of the people." — Jean de La Fontaine
Sep 3 '06 #2

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

Similar topics

7
by: Kevin Knorpp | last post by:
Hello. The account activation e-mails that I am sending to users who have registered at my site are getting filtered by spam blocking SW. However, some are getting through, but only 1 of 100 or...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
6
by: jerrygarciuh | last post by:
Hi folks, HELP!!!! My habitual use of mail() is causing me some grief. I am having slightly different results depending on the server I use but the gist is that mail() is returning 1, and I...
8
by: Robert Dufour | last post by:
Dim message As New MailMessage("mymail@mydomain.com", "mymail@mydomain.com", "Test", "Test") Dim emailClient As New SmtpClient("localhost") emailClient.Send(message) The IIS server is...
11
by: justsome_newbie | last post by:
Hello experts! I'm trying to send mail from my C# Asp.Net webpage. I used the code samples at www.systemnetmail.com but it still won't send. I think the problem is on the iis or exchange server...
12
by: e_matthes | last post by:
Hello everyone, I am trying to use the mail() function to send a simple, text-only message. I have two websites hosted by the same company, on different servers. One is old and established,...
5
by: jeddiki | last post by:
I am building my subscriber list which is held in the mySQL database "client" table and I want to start sending them a newsletter. My list will probably get up to around 20,000 I would like...
1
maliksleo
by: maliksleo | last post by:
hi i am using the following class for email sending but getting this error "Failure sending mail" Imports System.Net.Mail Public Class MailHelper ''' <summary> ''' Sends an mail...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.