is there a way to find out if the email is valid?

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

is there a way to find out if the email is valid?

Post by yacahuma »

Hello,


is there a way to find out if the email address I just sent a message is valid that is 100% reliable?


When I use an email client and I send and email to an invalid address I get a reply saying that the email does not exits.

Is the answer having a process that read and specific email account and checking for this errors??


Thank you
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: is there a way to find out if the email is valid?

Post by Chris Corbyn »

yacahuma wrote:Is the answer having a process that read and specific email account and checking for this errors??
Yes, you can use $message->setReturnPath($address) if you need to specify a different place for bounces to go.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: is there a way to find out if the email is valid?

Post by yacahuma »

great,

Can I read a pop server from swift?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: is there a way to find out if the email is valid?

Post by Chris Corbyn »

Swift doesn't read emails, it only sends them. Take a look at the IMAP functions in the PHP manual:

http://php.net/imap
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: is there a way to find out if the email is valid?

Post by yacahuma »

I found this link

http://www.weberdev.com/get_example-4015.html


It is amazing how complicated it is.

Some one should develop an odbc interface to mail.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: is there a way to find out if the email is valid?

Post by Chris Corbyn »

yacahuma wrote:Some one should develop an odbc interface to mail.
:) Take a look at Dovecot for flexible IMAP/POP access to mail on the server. Exim also is highly "pluggable" when it comes to storage of incoming mail. I've written MySQL transports for Exim in a previous job, then provided the web interface for reading that mail.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: is there a way to find out if the email is valid?

Post by yacahuma »

Could reading functionality be added to swift?

It will be nice to be able to do something like this:

$smtp = new Connection()
foreach ($smtp->GetMail()) as $message)
{
//message is an object with all the info
}

or

foreach($smtp->GetAllHeaders() as $headers)
{
}
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: is there a way to find out if the email is valid?

Post by Chris Corbyn »

It won't be added to Swift no. It's a bit like asking for FTP functionality to be added to a HTTP library ;) IMAP and SMTP are nothing like each other.

I do have plans to write a separate library for IMAP/POP but it's been on my TODO list for over a year now so as to whether it will ever happen I don't know :)
gmorehoudh
Forum Commoner
Posts: 50
Joined: Tue Mar 04, 2008 1:49 pm

Re: is there a way to find out if the email is valid?

Post by gmorehoudh »

It'd be nice, because the included PHP IMAP functions are incomplete and glacially slow.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: is there a way to find out if the email is valid?

Post by Chris Corbyn »

gmorehoudh wrote:It'd be nice, because the included PHP IMAP functions are incomplete and glacially slow.
Yep, and the interface for them sucks. I'm planning on writing one in the same modular style as Swift. It'd be a far bigger library however since IMAP is a huge protocol.
Post Reply