duplicate when sending email through swiftmail - php

I try to send email using swiftmailer the problem is, it send duplicate email (usually more than 3 mails) in same time, it only happen in my server (my local is fine though), first I think it because setting in my server and local is different but I don't find anything fishy, for your information my server running in ubuntu and my local run in xampp windows. please give me suggestion how to solve this

Related

Forcing PHP mail to mock success on dev server

I'm developing a Lumen API (on a VirtualBox) which will occasionally send out emails. However, on my dev server, I don't want to send mails; rather, I'd like the server to fake sending the mail and just return true. In the past, I've done conditionals that check if I'm on the dev server, if so, skip the entire sending mail process, but this feels like the wrong way to do it.
So what I'm trying to get to is: can I somehow get the server to not try sending the email and just move on? Am I thinking about this wrong, and should I try to get mail working on my VB or is a conditional the right way to go after all? I'd love advice on this.
If you are sending emails using illumenate/mail (Lumen 5.3 send email) you can set up the mail driver to log in your .env file for your dev environment. https://laravel.com/docs/5.2/mail.
If you are using your own functions for sending emails you should still get smtp server from .env, so you can set it to a server that will not send out any emails

Receive mail in localhost XAMPP PHP

I am trying to receive mails in my local server running XAMPP. I have Mercury and outlook configured and running according to this: http://system66.blogspot.in/2010/01/how-to-send-mail-from-localhost-with.html
My goal is that, I must be able to send a mail from xyz#somedomain.com to someaddress#localhost and I want to parse the received mail and store it in a MySQL DB.
I saw many references telling how to send mail from localhost (using gmail's smtp server using sendmail) but I dont find any resource telling me how to receive mail from anyone onto my local computer. Once I receive the mail to my PC, I can parse it and store it in DB. The only problem is getting the mail. Please help me out.
PS: I have configured php.ini and sendmail.ini files for doing the operations.
Firewalls are disabled and ports are available.
If you dont understand my question, imagine my pc as a mail server which is trying to get the mail sent to xyz#myserver.com
UPDATE : You need to configure DNS for your mail server. Take a look at this. Hope it would help.
You need to open port in your router & PC firewall in order to get requests from outside and a mail server.

'Test Mail Server Tool' only working in certain cases?

I'm currently using Test Mail Server Tool to send emails through the locahost server I have set up (WAMP).
For some reason, the first two e-mails I send work just fine (they show up in the received mail folder), but the other email that is sent from a different PHP file never shows up or mails. The function was working just fine, I didn't change anything. I even did some debugging to see where the code was going wrong - it goes right up to the function and then just doesn't work.
However - when I put the files on another computer, the function seems to work just fine. I made sure I have Skype and any other messaging service that takes up ports closed. I tried restarting my computer, restarting WAMP server and the tool, nothing seems to work.
Any ideas?

gmail settings for sending mail on mac

I'm using mac OS snow leopard, and i have probs with mail, i'm not sure is it something about gmail, or php mail() func.
It's not working. I wrote it this way (just for testing ).
mail('something#example.com', 'My Subject', 'My Message');
I done * i need with postfix configuration, but it's not working (can't get the mail).
Any help, just need explanation on how things work. I'm googling last 3-4 hours, but nothing (didn't find the right answer). And yes, i'm using local server.
Thanks!
If your application is hosted in local host the mails will not be able to send. Upload to a live server and check it. (You need a mail server to send the mails)
Just a tip - if something isn't working, try and find the problem withing your code before blaming gmail or php functions. These have been tested and re-tested in live environments by literally millions of people.
Do you have a mail server installed and configured? Do you have Apache sendmail enabled?

How to setup apache and php to make mail() function work on local machine

I am using php's mail() function to send an email from a php scrpit, however, this is not working. I believe the problem is with my php setup and the lack of an smtp server. Does anyone have experience with setting something like this up on a local machine and what can be done to fix this? Thank you
Yes I have on Windows machine. You should install local mail server, for example ArGoSoft Mail Server (www.argosoft.com). It's free, small and simple. Then setup a local domain in settings (for example weblocal.dom), then add a mail user (for example admin). So your test email will be admin#weblocal.dom. Then you just add this mail account to your email client program and send some mail to it from PHP script.

Categories