473,383 Members | 1,742 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,383 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 1034
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.