Jump to content
  • 0
exchisu

How to send a email from a script or sql table

Question

Hello everybody ! i have a Support Scrip In Game, who the people can write suggestion/errores etc.

 

Well, this script stores the user name and other stuff and the message in a SQL table..

 

well mi question

 

 

it is possible when a user write a suggestion or error send a e-mail for notify me ? 

 

can the script do that ?? or i dont know... or the sql table idk.. can anybody help me with that ?

 

Thanks

Share this post


Link to post
Share on other sites

17 answers to this question

Recommended Posts

  • 0

I remember someone did it however it can be done on windows OS only? Hmm. I don't quite remember. And also, i think this can't be done through script alone.

Share this post


Link to post
Share on other sites
  • 0

I remember someone did it however it can be done on windows OS only? Hmm. I don't quite remember. And also, i think this can't be done through script alone.

This can be done without source too, scirpy stores all things in SQL, php checks SQL regularly, and emails, else by using functions in c(source) to send email

Share this post


Link to post
Share on other sites
  • 0

 

I remember someone did it however it can be done on windows OS only? Hmm. I don't quite remember. And also, i think this can't be done through script alone.

This can be done without source too, scirpy stores all things in SQL, php checks SQL regularly, and emails, else by using functions in c(source) to send email

That's exactly what i think literally. :P

 

SCRIPT -> SQL <- PHP -> E-MAIL

Share this post


Link to post
Share on other sites
  • 0

 

I remember someone did it however it can be done on windows OS only? Hmm. I don't quite remember. And also, i think this can't be done through script alone.

This can be done without source too, scirpy stores all things in SQL, php checks SQL regularly, and emails, else by using functions in c(source) to send email

 

 

 

 

I remember someone did it however it can be done on windows OS only? Hmm. I don't quite remember. And also, i think this can't be done through script alone.

This can be done without source too, scirpy stores all things in SQL, php checks SQL regularly, and emails, else by using functions in c(source) to send email

That's exactly what i think literally. :P

 

SCRIPT -> SQL <- PHP -> E-MAIL

 

 

Then...it is possible with that, anybody can help me xD! ? Yea i know php can send a formulary system who send the email... but i dont know how to do it... i just have  Script > SQL 

Share this post


Link to post
Share on other sites
  • 0

why not just create a flux cp addons or what ever cp you are using that will display support ticket or what so ever that only admin can view...doing 'SCRIPT -> SQL <- PHP -> E-MAIL' is kinda waste of execution cause you need a 24/7 looping in the php just to process checking and sending to email..which in fact 'SCRIPT -> SQL <- PHP' is better...I'm just suggesting..:D

 

:meow:

Share this post


Link to post
Share on other sites
  • 0

why not just create a flux cp addons or what ever cp you are using that will display support ticket or what so ever that only admin can view...doing 'SCRIPT -> SQL <- PHP -> E-MAIL' is kinda waste of execution cause you need a 24/7 looping in the php just to process checking and sending to email..which in fact 'SCRIPT -> SQL <- PHP' is better...I'm just suggesting.. :D

 

:meow:

 

 

I dont know how to create that. thats why im asking here.

 

I have the Script on my Sv who the players write, then this is send to a SQL table.. but i need.. each time a player Write something in the Npc, a email send to me... because i can read it in the Cellphone....

 

I have: THE SCRIPT who send the message to a SQL table.

 

i Need: The Script who send the message to a SQL table, then send a email to me.

 

anybody ?

Share this post


Link to post
Share on other sites
  • 0

Hmm yeah you need to loop like 24/7 to be able to get the inquiries as real-time as possible. I raise up that suggestion because the topic starter insist that he wants a support npc in-game. :P

Share this post


Link to post
Share on other sites
  • 0

Hmm yeah you need to loop like 24/7 to be able to get the inquiries as real-time as possible. I raise up that suggestion because the topic starter insist that he wants a support npc in-game. :P

Not really, one can just directly send request to php to fetch a specific Id from SQL, so does not necessarily need 24/7 looping

Share this post


Link to post
Share on other sites
  • 0

If I may add something to this "looping" you guys are talking about. Do you all mean cronjobs? If it is, I don't see it being an "overkill" regardless of the time you want it to run. You can even set it to every minute.

 

> Create a PHP script that reads the table where the suggestions are stored.

> Add a flag field in that table where 0 = not sent and 1 = sent. Set the value for this field to 0 as default.

> PHP script will only select the records that are flagged as 0 and execute the mail function containing the data.

> When mail is executed, set the flag of each record to 1.

Edited by Swift

Share this post


Link to post
Share on other sites
  • 0

I think it would be better if suggestions were submitted through a web form, that way it's easier to send notifications whenever a suggestion has been submitted.
But what you seek is possible using cronjobs.

Edited by takari_L

Share this post


Link to post
Share on other sites
  • 0

I think it would be better if suggestions were submitted through a web form, that way it's easier to send notifications whenever a suggestion has been submitted.

But what you seek is possible using cronjobs.

 

what about that cronjob, i learn is cPanel but... more ideas for this theme ? like SCript - SQL - ... what more ? (⊙.⊙(◉̃_᷅◉)⊙.⊙)

Share this post


Link to post
Share on other sites
  • 0

Cron is a job sheduler, hence the name "cronjob". Every script you set to it will be its job to run on whatever the time is set to it.

 

Example.

 

A PHP script that cleans a log table in the database every 24 hours.

Edited by Swift

Share this post


Link to post
Share on other sites
  • 0

as swift said, it's a job scheduler. Basically the idea is that cronjob will execute a certain script in the time you set it.
If you have cpanel, then it should be easy for you since it has a cronjob manager tool. Here's how it should go:
 

  1. Create a PHP script that will:
    • Fetch new reports/suggestions. (for this you should have some sort of status column so you can identify sent items from new items)
    • Setup your SMTP/PHP email configuration, and send the email containing the reports/suggestions.
    • Update the status of those reports/suggestions so it wouldn't be sent again (You wouldn't want it spamming your email)

[*]Use CPanel's Cronjob Manager Tool. Select the PHP script you just created. [*]Specify the interval you want it to execute. You may select every 15 minutes/30 minutes. Whatever floats your boat.
You can even do every minute if you want.

Share this post


Link to post
Share on other sites
  • 0

 

why not just create a flux cp addons or what ever cp you are using that will display support ticket or what so ever that only admin can view...doing 'SCRIPT -> SQL <- PHP -> E-MAIL' is kinda waste of execution cause you need a 24/7 looping in the php just to process checking and sending to email..which in fact 'SCRIPT -> SQL <- PHP' is better...I'm just suggesting.. :D

 

:meow:

 

 

I dont know how to create that. thats why im asking here.

 

I have the Script on my Sv who the players write, then this is send to a SQL table.. but i need.. each time a player Write something in the Npc, a email send to me... because i can read it in the Cellphone....

 

I have: THE SCRIPT who send the message to a SQL table.

 

i Need: The Script who send the message to a SQL table, then send a email to me.

 

anybody ?

 

http://herc.ws/board/topic/295-feeftys-fluxcp-addons-release/

Support Tickets - Version 1.2.1

Share this post


Link to post
Share on other sites
  • 0

 

 

why not just create a flux cp addons or what ever cp you are using that will display support ticket or what so ever that only admin can view...doing 'SCRIPT -> SQL <- PHP -> E-MAIL' is kinda waste of execution cause you need a 24/7 looping in the php just to process checking and sending to email..which in fact 'SCRIPT -> SQL <- PHP' is better...I'm just suggesting.. :D

 

:meow:

 

 

I dont know how to create that. thats why im asking here.

 

I have the Script on my Sv who the players write, then this is send to a SQL table.. but i need.. each time a player Write something in the Npc, a email send to me... because i can read it in the Cellphone....

 

I have: THE SCRIPT who send the message to a SQL table.

 

i Need: The Script who send the message to a SQL table, then send a email to me.

 

anybody ?

 

http://herc.ws/board/topic/295-feeftys-fluxcp-addons-release/

Support Tickets - Version 1.2.1

 

this say: FluxCP Addons... i didnt have Flux  :unsure:

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.