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

How to create an email box in my domain

12
Hello,

Please how can I set up an email box in my domain. I have the php code and wish to create an email address as a recipient. The attached is the php codes I intend to use.

Thanks

Emeka
Attached Files
File Type: txt email.txt (884 Bytes, 411 views)
Dec 26 '09 #1

✓ answered by Dormilich

do you want to send or receive emails via your server? for the latter you explicitly require a mail server, while sending only requires a mail script.

PS. sending emails is more comfortable, if you use a mail library, like Swiftmailer.

21 3751
Dormilich
8,658 Expert Mod 8TB
do you want to send or receive emails via your server? for the latter you explicitly require a mail server, while sending only requires a mail script.

PS. sending emails is more comfortable, if you use a mail library, like Swiftmailer.
Dec 26 '09 #2
Emeka
12
Thanks. My domain has the following features; MySQL sever under the admistration of phpMyAdim and java codes. The POP email server is ****. The previous attachment is the php codes I intend to use. Please I need some clues on how to create an exprimental email box in my domain to send and receive emails in my server. Can you please edit the source code.
Dec 26 '09 #3
Dormilich
8,658 Expert Mod 8TB
Can you please edit the source code.
no.

because I'd make that in a totally different way.

to get email from the server, I'd always use an email client (thunderbird, eudora, sylpheed, etc.), same goes for when I want to write an email myself. It needs special circumstances to use a web frontent for the mail server (form processing, blog comment notification ...).
Dec 26 '09 #4
Emeka
12
OK. Please is there any way you can help? I joined this IT group to gain practical advice from experts like you in php programs.
Dec 26 '09 #5
Dormilich
8,658 Expert Mod 8TB
Please is there any way you can help?
I hope so.

first thing you have to do is figure out, what you want to do exactly. (as I said, using mail clients can prevent many problems).

once you know what you have to do with a web form, you need to design the web interface (HTML/CSS/JavaScript). then you have to think, what the PHP code should do. you need a way to sanitize user input and so on.

rule of thumb: there is no need to reinvent the wheel.

I hope this helps at least a little

this is my current newsletter script (only top level shown). please note that this script (though looking rather simple) requires two additional classes and the aforementioned SwiftMailer library.
Expand|Select|Wrap|Line Numbers
  1. function sendMail()
  2. {
  3.     // since the user input comes from a restricted place,
  4.     // the usual input validation is omitted
  5.     $text    = $_POST["NLG"];
  6.     $betreff = $_POST["betreff"];
  7.  
  8.     // send mail only, if every required field was filled
  9.     if (!$text or !$betreff) 
  10.     {
  11.         echo '<p>Bitte alle Felder ausf&uuml;llen!</p>';
  12.         return false;
  13.     }
  14.  
  15.     // preparing auto text (mail footer)
  16.     $msg = "Liebe(r) {name},\n\n" . $text . "\n_______________\n\nZum Abmelden klicken Sie auf: http://www.example.org/abmeldung.php?uid={UID}\noder rufen Sie diese Adresse im Browser auf.";
  17.  
  18.     // send mails to every recipient from the DB
  19.     // thrown Exceptions are caught somewhere else
  20.     $RS = new BatchMail($msg, $betreff); 
  21.     $RS->setTo(getMailAdresses());
  22.     $RS->send();
  23.     saveMail($text);
  24.     // print mail success 
  25.     echo $RS;
  26. }
Dec 26 '09 #6
Emeka
12
Thanks alot. I am aware that html, css and javaScript will be involved. I just want to expriment on creating a form on web through which mails can be sent to my domain. Already I have created a mail box with the domain's name. One more question please, how can I link the code to my domain?
Dec 26 '09 #7
Dormilich
8,658 Expert Mod 8TB
how can I link the code to my domain?
which code?
Dec 26 '09 #8
Emeka
12
Ok thanks. I have little knowledge in php and wish to improve by practise and asking question. I mean is there any configuration between the php code and my domain? I have created an email box with my domain's name.
Dec 26 '09 #9
Dormilich
8,658 Expert Mod 8TB
well, that depends on what code you use. PHP's mail() function does not use SMTP, but if you wish to use SwiftMailer, check out it's excellent documentation (set the SMTP host in Swift_SmtpTransport)
Dec 26 '09 #10
Emeka
12
Please I am somehow confused. Please explain. The code I intend to use is PHP code. Which one will I use since PHP codes do not use SMTP?
Dec 26 '09 #11
Dormilich
8,658 Expert Mod 8TB
The code I intend to use is PHP code.
PHP code is able to use SMTP. it is only a question, which one*.
Alas, if you mean your PHP code, all you need to know is in the PHP manual (ref. mail())

(As I mentioned, using an email library (which is also PHP code) allows you to use email via SMTP.)

I still recommend using an email library. much easier if it comes to HTML mail and attachments

* it most probably requires the use of sockets
Dec 26 '09 #12
Emeka
12
Very sorry I have to go to bed after waiting for your reply. I want to have knowledge of both, the use of email library and PHP code. Please give me an example of email library and sockets (for PHP code).
Dec 27 '09 #13
Dormilich
8,658 Expert Mod 8TB
Very sorry I have to go to bed after waiting for your reply.
I have been busy with Phileasson.

I want to have knowledge of both, the use of email library and PHP code.
there is no difference between them, since the library is PHP code.

Please give me an example of email library and sockets (for PHP code).
see my demo example.
don't bother with sockets (yet), that's advanced PHP. the library will do that and all other necessary things for you.
Dec 27 '09 #14
Emeka
12
Ok I will give it a trial and give you feedback. What i really want to expriment on is a form on the web designed with PHP used to send and recieve email messages. Already I have designed a skeletal form, email box from my domain where the messages will be sent to. I will use your above demo example as design engine that will connect the front-end with the back-end.
Dec 27 '09 #15
Dormilich
8,658 Expert Mod 8TB
first try just sending emails… receiving emails is a lot more complicated. and I still recommend to use an email client to receive emails.
I will use your above demo example as design engine
that demo is useless without the incorporated classes.
Dec 27 '09 #16
Emeka
12
Thanks. IF there is any further help you give, it will be highly appreciated. I have made my objectives known to you.
Dec 28 '09 #17
Dormilich
8,658 Expert Mod 8TB
IF there is any further help you give, it will be highly appreciated.
yea, for a first step get the email sending running.
Dec 28 '09 #18
Emeka
12
Hello Dormilich,

I have been able to use PHP code to receive mails. The difficulty I am having is to automate reply of letters from my mail box with the first PHP code you gave. How can I combine the receiving and sending PHP code. The code you gave to me was used for sending.
Jan 21 '10 #19
Dormilich
8,658 Expert Mod 8TB
How can I combine the receiving and sending PHP code. The code you gave to me was used for sending.
you’ll need a mail server to receive emails, while sending emails doesn’t.
Jan 21 '10 #20
Emeka
12
I have been able to receive mails. I want to apply auto-reply. Please how can I combine the PHP codes? HTML and CSS was use to design the web interface.
Jan 21 '10 #21
Dormilich
8,658 Expert Mod 8TB
besides a cron job, that regularly checks the mailbox, I have no other idea … maybe someone else knows better.
Jan 21 '10 #22

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

Similar topics

2
by: Keith Jakobs, MCP | last post by:
Greetings: I had seen several posts around the Internet about this issue from a few months back, but have been unable to find a resolution ... I have a user who is trying to get started with...
4
by: Ron Vecchi | last post by:
I a runnning w2k3 pop3 mail server that came with iis6. I would like to write an application that progammtically creates the new mailboxes in an already established mail domain. Does anyone know...
4
by: anders | last post by:
Hi! To create a new Windows account I use this code: const int UF_PASSWD_CANT_CHANGE = 0x0040; const int UF_DONT_EXPIRE_PASSWD = 0x10000; DirectoryEntry obDirEntry = new...
2
by: vbnetdev | last post by:
This code does not work. I would appreciate any suggestions. I have to specify a domain name that is not even in its container otherwise it objects with errors abotu the method being invalid at...
0
by: comp.lang.php | last post by:
I wrote a method that should check if an email address is valid. In another method I've already checked to see if $_POST exists and is well-formed, so those checks are not necessary in this scope....
8
by: Brady Love | last post by:
I am very new to asp.net and I am currently working on an application that when users sign up it also creates a email account for them.I have done some reserch and found that this is possible to do...
5
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
7
by: tirrell payton | last post by:
Hello, I am attempting to validate my user's email addresses by sending them a link. However, I am having trouble concatenating the variable name (GUID) into the url. Im using C#: public...
2
by: Hughesie11 | last post by:
Im trying to post from a form to send an email, im using CDONTS ( I have to as it will be running on NT4), the object appears to get created fine, however the email is not sending, its generates 3...
4
by: mark4asp | last post by:
I want to write a xslt template to create a xhtml 1.0 (transitional) file which will be sent in as email. Here is a typical xml data file: <BatchEmail> <Domain>www.myDomain.com</Domain>...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.