[FX.php List] [OFF] Slow response when sending PHP email?
Joel Shapiro
jsfmp at earthlink.net
Fri May 10 12:50:15 MDT 2013
Howdy Steve
Thanks for the additional idea. I've never done any SMTP server setup so will probably start down the AJAX route, but it's an interesting option. (If I come back to it, I'll let you know :)
Cheers,
-Joel
On May 9, 2013, at 1:30 PM, Steve Winter wrote:
> Hi Joel
>
> I've seen the effect which you refer to, with mails slowing things down. The way in which I've handled this in the past is to run a relaying SMTP server on the web host - typically with FileMaker installs clients are using IIS, so what I tend to do is set up the IIS SMTP server on that local machine (configured to only accept and relay mail from the localhost).
>
> That means that there is no latency in the connection from PHP to the SMTP server and a very speedy response is received - from there the IIS STMP server is configured to hand that message off to the client's 'real' SMTP server wherever that may be…
>
> It's not foolproof, in that the verifications that end up being done are less thorough than it might be, but means that it's most likely a valid mail message which will be delivered, and the response time back to PHP is high…
>
> Hope this helps…
>
> Cheers
> Steve
>
>
>> Hi Bob
>>
>> You don't see slower page loading when you include PHP mailing -- compared to the same page without emailing? (or you just never checked?) For me, adding in the mailing adds at least a couple/few additional seconds before the page will load.
>>
>> Yeah, I've also seen that adding multiple new records is probably the slowest thing with CWP, and also found that calling an FM script instead to do the record creation is a LOT faster. (I even blogged about it :). I haven't, though, tested this in FM12. Have you had a chance to see if adding multiple new records in FM12 is still really slow?
>>
>> And lastly, out of curiosity, why don't you like to email from FMS? I've given up my earlier belief that everything has to be pure PHP, and have toyed w/ the idea of calling an FM script from the PHP to have FMS send smtp emails. I do realize this puts an additional load on the DB server -- as opposed to on the Web server...
>>
>> Thanks,
>> -Joel
>>
>>
>>
>> On May 8, 2013, at 7:34 PM, Bob Patin wrote:
>>
>>> Joel,
>>>
>>> I haven't noticed it delaying things, but that may be because I always send mail after I've rendered the final page--which might be an invoice, for example.
>>>
>>> The issue that has been more troublesome for me has been when I have to generate a lot of records--for example, on some ticket orders I have to create as many as 13 records at one time, and that can take time. In that instance I've off-loaded the record creation to FileMaker, so that the site seems fast and responsive.
>>>
>>> You can always try that--have FileMaker send the emails--although I really don't care for that at all. One of the web apps I'm about to rewrite has a function in it where emails go out from the database, and I plan to do away with that and do all sending straight from PHP.
>>>
>>> I used to use a function someone gave me years ago, called "sock_mail" I believe. I use PHPMailer now though, mainly because it allows for attachments, and I send PDF files a lot these days in web apps.
>>>
>>>
>>> Bob Patin
>>> Longterm Solutions LLC
>>> P.O. Box 3408
>>> Brentwood, TN 37024
>>> bob at longtermsolutions.com
>>> 615-333-6858
>>> http://www.longtermsolutions.com
>>> iChat: bobpatin
>>> AIM: longterm1954
>>> Twitter: bobpatin
>>> Google+: http://www.longtermsolutions.com/plus
>>> --
>>> FileMaker 9, 10 & 11 Certified Developer
>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>> --
>>> FileMaker hosting and consulting for all versions of FileMaker
>>> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>>> On May 8, 2013, at 5:09 PM, Joel Shapiro <jsfmp at earthlink.net> wrote:
>>>
>>>> Hi all
>>>>
>>>> I haven't needed to send mail from PHP for a while but I may need to do so in an upcoming project.
>>>>
>>>> One thing that has bothered me when I've used an email library (Swift Mailer or PHPMailer) is that it seems to take quite a long time (3+/- seconds) for the mail to send, thus delaying the loading of the 'results' page. I understand that this way I can check for failed sending, but I generally don't want to delay things for the end user for that -- and I'd rather deal w/ them behind the scenes, on the server end.
>>>>
>>>> How do others here deal with this? Is there a way to off-load the email sending so that the user gets a quick response to their submission? AJAX perhaps?
>>>>
>>>> TIA,
>>>> -Joel
>>>>
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> Steve Winter
> +44 777 852 4776
> steve at bluecrocodile.co.nz
>
>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list