473,387 Members | 1,903 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,387 software developers and data experts.

Mail delay problem

Hi,

I need to insert some records to a table and then need to send a mail. while using mail() function in php, it takes 20 to 25 seconds to send a mail. insert query executes immediately. but if i do any operation in the page it takes 20-25 seconds. it works properly when i get the mail.

code which im using my page.
$headers = "From:kamal@company.com \n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
$recipient = "raja@gsecone.com";
$subject = "Test subject";
$htmlbody = "Content text";
mail ($recipient, $subject, $htmlbody, $headers);

do you have any idea?

Thanks.
Feb 28 '08 #1
2 1424
Markus
6,050 Expert 4TB
I don't understand your problem.
Feb 28 '08 #2
I don't understand your problem.

hi mark,
thanks for your reply... actually i've to do two operations. one is to insert records to database (im using mysql) and another one is to send a mail to somebody.
In my code first im using insert query then im using mail(). The problem is, while submitting my form i cann't able to do any another operation which is related to corresponding table (where i inserted records) like i cann't select particular records (using SELECT query) or i cann't show the newly added records to my list. i can do it normally when the mail will be sent. So how can i continue any operation after insert a record. that is i don't want to wait to send a mail.

My code is
[php]
$qry = "insert into tbl values($val1,$val2)";
$res = mysql_query($qry);
if($res){
$isadded = true;
}
if($isadded){
$headers = "From:kamal@company.com \n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
$recipient = "raja@gsecone.com";
$subject = "Test subject";
$htmlbody = "Content text";
mail ($recipient, $subject, $htmlbody, $headers);
}[/php]reply me if you have any idea....

Thanks.

See the Posting Guidelines before you show any more code! Code must be enclosed within the appropriate code tags. - moderator
Feb 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: knoak | last post by:
Hi there, I've found a script at these great Google fora. a script to send emails with attachments. The script is below this message, name etc. aren't mine, but from the original post. My...
9
by: joealey2003 | last post by:
Hi all... A simple mail example like... <? mail("acco...@yahoo.com","Subject of Message","Message"); ?> does not work to yahoo or spymac.com, but the same works to gmail and other servers.
3
by: trend5 | last post by:
I have a simple mail script designed to use from command line. I want create a simple web interface to use this script as remotely hosted webscript, from webhost. The script contains two files-...
14
by: Des L. Davis | last post by:
System: Dell PowerEdge Server with 3 GB RAM, 2.4 GHz Celeron Software: Microsoft SQL Server 2000 Enterprise running on Windows 2003 Server Software: Microsoft SQL Server 2000 Enterprise running on...
7
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have...
9
by: JoshP | last post by:
Hi all, I am using an asp.net page to send e-mail to an internal exchange server. The code completes, but the mail doesn't get sent from webserver for at least a minute or more. Is there any...
1
by: maflatoun | last post by:
Hi everyone, I'm coverting some of our code here from the old way of send email in ..net 1.1 to the new .net 2.0. However, everyone I switch the code the new method there is a delay of 1-2...
2
by: mazdotnet | last post by:
Hi everyone, I'm coverting some of our code here from the old way of sending mail in ..NET 1.1 to the new .NET 2.0. However, everytime I switch the code to the new method there is a delay of 1-2...
4
by: Alec MacLean | last post by:
Is anyone aware of a size limit imposed on the subject text when using the System.Net.Mail library? I'm getting problems of message not being recieved if the subject exceeds 15 chars. Thx
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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,...

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.