Jump to content

PHP Email Login / Server


PC Nerd

Recommended Posts

hi guys,

 

im setting up a third party email for my domain...... so that i can create xyz@domain.com, and keep emails etc even while i change hosts etc.

 

however, what i want to do is setup an account, for contact, and have filters, that keeps track of 5 other email boxes...... and forward each incoming email into the first email, to the email with the lowest emails....

 

ill explain further:

 

email2me.com:    main email box

 

1@... = 27 emails sent to.

2@... = 27 emails sent to

3@... = 25 emails sent to

4@... = 30 emails sent to

 

what i want to happen, is when an email comes into email@me.com, i want it to automatically forward that email to the other email ( 1@ 2@ etc) address, who has the lowest amount of emails been sent to them.

 

i can store the number in a database, or even a text file if i needed, however, i need like a) a cron setup or something, that logs into othe emal service, then forwards that email.  is this possible with php, or how would i go about it.

 

what it really is, is to spead like support emails and requests, amongst support technitions etc, so that they can have their own personal emails, and the global one ( email@me.com) doesnt have to have multiple logged into it etc.

 

 

i dont even know if this is possible within php, but is it possible to automatically do it through my DNS management, where its edited MX records etc?

 

thanks for your help in advance,

 

yours, PC Nerd

 

Link to comment
Share on other sites

i dont want a script, i want to know if its possible to do in php only, is it really that hard....

 

btw, i asked something there, and didnt get answered, so instead of bumping 50 times, i just posted new......

 

Link to comment
Share on other sites

um, would it be better if i vhave a cron, running on the hour or something..... that runs as a POP3 client?  then it would have complete control over the emails? if so, could someone point me in the way is a nice tutorial, thats reasonably simple?

 

thanks for your help,

Link to comment
Share on other sites

ok, firstly thanks.

 

Im not really familiar with the -> functions etc.... also, is there a simple way to retreive email using php, even if its not POP3? the only thing im looking for, is the ability to forward an email..... i dont even have to be able to read anything... etc.

 

thanks for your help, Yours PC_Nerd

Link to comment
Share on other sites

-> is just the way you handle classes..

 

the reason i posted how to read is because your need to read in the mail and then send it out.. i don't know of another way to forward them (direct from php).. if not pop3 then maybe imap..

 

if you have imap support

<?php phpinfo(); ?>

 

you could just read the IMAP section

<?php
$server = "domain.com";
$user = "mad";
$pass = "techie";
$conn = @imap_open("\{$server/imap}INBOX", $user, $pass)or die("Connection to server failed");
$headers = @imap_headers($conn) or die("Couldn't get emails");
$numEmails = sizeof($headers);
echo "You have $numEmails in your mailbox";
for($i = 1; $i < $numEmails+1; $i++)
{
$mailHeader = @imap_headerinfo($conn, $i);
$from = $mailHeader->fromaddress;
$subject = strip_tags($mailHeader->subject);
$date = $mailHeader->date;

echo "Email from $from, subject $subject, date $date<br>";

$body = nl2br(strip_tags(imap_body($conn, $i)));
echo "$body<br>";
}

imap_close($conn);

?>

 

hope this helps (was ripped from an old project)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.