Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jprauch
Starting Member
2 Posts |
Posted - 2012-05-09 : 17:07:54
|
| Hi, I just created a SQL database and I have it setup to email the admin whenever there is a submission. Currently, when the admin gets an email it is from the database username (user@quattro.websitewelcome.com). Is there a way I can change this to something else? I would prefer it be something like 'submission@mydomainname.com'.Thanks so mcuh |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
jprauch
Starting Member
2 Posts |
Posted - 2012-05-09 : 19:26:24
|
| Not familiar with Database mail...Here's how im doing it://echo $query;//print_r($rows);$post = "";foreach ($_POST as $k => $v) { if (is_numeric($k)) { foreach ($rows as $row) { if ($row['qid'] == $k) { $post .= "\r\n\r\n " . $row['qt']; break; } } } else if ($k == 'office') { } else { $post .= "\r\n\r\n $k => $v "; }}$query = "SELECT a.`email` AS email FROM `offices` AS o JOIN agents_offices AS ao ON ao.office = o.id JOIN agents AS a ON a.id = ao.agent WHERE o.id='$office'";$result = mysql_query($query) or die("Error getting office email: ". $query);while($row = mysql_fetch_assoc($result)) { $email = $row['email']; mail ($email , "CAREER INQUIRY" , "A new form submission has occured with the following data: " . $post);}echo "Your information has been successfully submitted. A CAREER ADVISOR will contact you soon. Thanks."; ?> |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|