Php sendmail ローカル環境でのテスト
サンエツと申します。
webサイトの構築が目的です。
1.DreamWeaberを購入検討をしておりますが、phpのsendmailでローカル環境からメール送信のテストはできるのでしょうか?
2.ftpのログインなどもローカル環境でテストできますか?
3.ftpのローカル環境でファイルのアップロードテストなどは出来ますか?
上記は、Aptana Studio 3ではできましたが、Microsoft Expression Web 4ではできませんでした。
当方の環境は
win7
xampp
になっています。
どうぞよろしくお願いします。
On 20 Jan 2009 in macromedia.dreamweaver, Alan wrote:
> as far as i know, you would have to send html email
headers, then
> use html or css to style the text to bold.
That's correct.
>
http://www.google.com/search?hl=en&ie=ISO-8859-1&q=tutorial+send+html
> +email+ php
In general for all things PHP, your first stop should be
http://www.php.net/ In this case,
see Example 4 at:
http://www.php.net/manual/en/function.mail.php
Joe Makowiec
http://makowiec.net/
Email:
http://makowiec.net/contact.php
Similar Messages
-
Has anyone been able to get php sendmail to work on Yosemite? If so is there any complete documentation or hey how about a script to fix it. That should have been part of Server app.
Hah, lol, my bad, didn't think about that. Worked when I did.
-
Hi there,
I'm using a PHP sendmail script, although I want some of the
writing to be emailed in BOLD font, it isn't the field results,
it's the bit after the 'sprint' in the script I'd ideally like to
be bold.
Would be fanastic if anyone could share their knowledge.
Regards,
Kristopher (UK).On 20 Jan 2009 in macromedia.dreamweaver, Alan wrote:
> as far as i know, you would have to send html email
headers, then
> use html or css to style the text to bold.
That's correct.
>
http://www.google.com/search?hl=en&ie=ISO-8859-1&q=tutorial+send+html
> +email+ php
In general for all things PHP, your first stop should be
http://www.php.net/ In this case,
see Example 4 at:
http://www.php.net/manual/en/function.mail.php
Joe Makowiec
http://makowiec.net/
Email:
http://makowiec.net/contact.php -
Hi Experts,
my site created in Dreamweaver's HTML looks ok, however the
PHP script cannot capture the Enquiry data to send to the my target
email addr. Is there some setting I had missed out, or myscrpt is
wrong. I had enclosed my PHP scripts for your reference, pls kindly
adv where could have gone wrong. Tks.....!
<?php
$fname = $_POST['FirstName'];
$Job = $_POST['Designation'];
$Comp = $_POST['Company'];
$email = $_POST['Email'] ;
$comments = $_POST['Comments'] ;
$to = "[email protected]";
$re = "Enquiry";
$msg = $comments;
mail( $to, $re, $msg);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head><title> Your Enquiry
</title></head>
<body>
Thank you <?php echo($fname); ?> from <?php
echo($Comp); ?>. We will follow-up with your enquiry soon.
</body>
</html>Your script is not using most of the data you have captured.
For example,
you are not using -
> $fname = $_POST['FirstName'];
> $Job = $_POST['Designation'];
> $Comp = $_POST['Company'];
> $email = $_POST['Email'] ;
It is only sending $msg (which is copied from $comments).
You would need to append each of these variables to the $msg
string.
Be aware that you are open to hacking by using this very
simple sendmail
script. At the least, you should remove HTML and carriage
return characters
from the comments field.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Puzzle Ice" <[email protected]> wrote in
message
news:fdq029$dat$[email protected]..
> Hi Experts,
>
> my site created in Dreamweaver's HTML looks ok, however
the PHP script
> cannot
> capture the Enquiry data to send to the my target email
addr. Is there
> some
> setting I had missed out, or myscrpt is wrong. I had
enclosed my PHP
> scripts
> for your reference, pls kindly adv where could have gone
wrong.
> Tks.....!
>
> <?php
> $fname = $_POST['FirstName'];
> $Job = $_POST['Designation'];
> $Comp = $_POST['Company'];
> $email = $_POST['Email'] ;
> $comments = $_POST['Comments'] ;
>
> $to = "[email protected]";
> $re = "Enquiry";
> $msg = $comments;
> mail( $to, $re, $msg);
> ?>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
> <head><title> Your Enquiry
</title></head>
> <body>
> Thank you <?php echo($fname); ?> from <?php
echo($Comp); ?>. We will
> follow-up
> with your enquiry soon.
>
> </body>
> </html>
>
> -
Hello there,
I have managed to find a send-mail script in PHP in order for
site users to be able to send me their comments, questions, etc.
However, I receive the email but I only receive what the user has
selected in the drop down menu, I can change this to any of the
fields but my problem is, I'm wanting it to email me ALL the
fields, not just one. I've attached the following PHP code below.
I'd be very grateful if anyone could help.
Regards,
Kristopher (UK).<?
$message = "An email sez: ";
foreach($_POST as $key => $value) {
$message .= $key . ": " . $value;
mail( "[email protected]", "Feedback Form Results",
$message, "From: $email" );
header( "Location:
http://www.google.co.uk" );
?>
Be aware that your use of sendmail without any security
measures makes you a
juicy target for email injection techniques -
http://www.nyphp.org/phundamentals/email_header_injection.php
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Coxdabd" <[email protected]> wrote in
message
news:gb967k$9qr$[email protected]..
> Hello there,
>
> I have managed to find a send-mail script in PHP in
order for site users
> to be
> able to send me their comments, questions, etc. However,
I receive the
> email
> but I only receive what the user has selected in the
drop down menu, I can
> change this to any of the fields but my problem is, I'm
wanting it to
> email me
> ALL the fields, not just one. I've attached the
following PHP code below.
>
> I'd be very grateful if anyone could help.
>
> Regards,
>
> Kristopher (UK).
>
> <?
> $name = $_REQUEST['name'] ;
> $message = $_REQUEST['message'] ;
> $select = $_REQUEST['select'] ;
>
> mail( "[email protected]", "Feedback Form
Results",
> $message, "From: $email" );
> header( "Location:
http://www.google.co.uk" );
> ?>
> -
PHP Sendmail [SOLVED]
I am trying to use a PHP script to send mail with the PHP mail() function. Looking at phpinfo(), I see "/usr/sbin/sendmail -t -i" for the local and master values of sendmail_path. However, if I manually issue "/usr/sbin/sendmail -t -i" as root, I receive the error "-bash: /usr/sbin/sendmail: No such file or directory". Do I need to install sendmail? I cannot find a package for it on Arch... Does anyone know what I am doing wrong?
Last edited by tony5429 (2008-04-25 18:41:03)Try postfix, courier-mta or ssmtp. All of them have a sendmail binary. If you don't need a full-blown mta, ssmtp may be the best bet, but any will do.
-
Apache / PHP / sendmail
I moved my forums from a hosting provider to my home Arch install. Currently emails are not being sent out. I noticed that /usr/sbin/sendmail didn't exist so installed postfix which resolved that issue. However emails are still not working. Any ideas what the issue might be or at least where the error logs would be?
Hi.
When you say your "home Arch install" do you mean a server at your home location? If yes then I guess the most likely culprit is either:
a) Your IP is blacklisted (Quite possible with consumer grade ISPs)
b) Your ISP is messing something up (Some ISPs disallow email traffic)
c) Your DNS isn't configured correctly and foreign servers refuse to deliver our mail. -
Hi there,
I'm using a PHP send mail script to email the form results
over to me. For the message, I want several fields to be in the
actual message. I've seen that you simply need to insert the '.'
However this simply seems to put the additional fields on the end
of the previous. I want it as a separate paragraph as it were. The
code is below:On Sat, 10 Jan 2009 15:25:20 +0000 (UTC), "Coxdabd"
<[email protected]> wrote:
> <?php
> $name = $_REQUEST['name'] ;
> $message = $_REQUEST['telephone'] ;
> $message .= $_REQUEST['required'] ;
> $message .= $_REQUEST['date'] ;
> $message .= $_REQUEST['time'] ;
>
> mail( "[email protected]", "Booking Request",
> $message, "From: $email" );
> header( "Location:
http://www.me.com" );
> ?>
Try it this way:
<?php
$name = $_REQUEST['name'] ;
$message = sprintf("Telephone: %s\n",$_REQUEST['telephone']);
$message .= sprintf("Required: %s\n",$_REQUEST['required']);
$message .= sprintf("Date: %s\n",$_REQUEST['date']);
$message .= sprintf("Time: %s\n",$_REQUEST['time']);
mail( "[email protected]", "Booking Request",
$message, "From: $email" );
header( "Location:
http://www.me.com" );
?>
Currenly your form is very insecure. You should see some of
these:
http://www.google.com/search?q=php+mail+header+injection
Gary -
I'm going crazy trying to get exim to do what I want it to. Basically, every mail that I send (locally to myself) is being frozen. I CAN send with php sendmail. I can hardly find any info at all on this, so I'm not even sure if exim is the right program to achieve what I want.
Basically I have a server on a domain that needs to have a couple email accounts.
[email protected]
[email protected]
etc.
But they're not really email accounts. I just want the server to receieve the mail and then forward it to the admin's personal email.
Is exim really the right way to do this? If so, I can post more of my configuration.
Last edited by Statix (2008-11-21 08:05:49)Well I have only used postfix, but it sounds like exim is not differentiating between a virtual and local user, there should be some way of defining that email sent to [email protected] from the local network should be delivered to <user x>. It is probably trying to send the email from [email protected] to {[email protected]}@localhost if you get what I mean? Rather than name@localhost.
In postfix you do it by defining a local domain, and then mapping the virtual addresses to local ones.
Exim is the right thing to be using, mail servers are a bitch to get working beyond the basic pass through stuff -
Has anyone come up with a solution for the consistent problem between Adobe Muse forms and GoDaddy hosting? I just spent an hour with GoDaddy and they said everything on their end was working. It was a script problem. I can't seem to get any answers from either Adobe or GoDaddy.
From your description is seems clear the issue is not with the Muse generated scripts. Those are identical regardless of what e-mail address you're sending to. If sending to your personal e-mail address works, but sending to an address on the same domain as the site does not, that most likely indicates one of two things: 1) The e-mail address is not setup correctly. (I assume that's not the case and you can send to the address from other sources without issue?) 2) Or, something on the server is configured to block e-mail from being sent to addresses on the domain of the site. Some hosting providers do this by default.
I expect this case is the latter and you have yet to reach a tech at GoDaddy who's familiar with this aspect of their e-mail processing via PHP sendMail.
The lack of SQL is a non-issue. SQL is not required for the correct processing of your form. When available SQL is used to limit the number of form submissions that will be accepted from a single IP address (site visitor) in a short amount of time. This "throttling" is performed to limit submissions from spammer's robots. Your form will work fine regardless of whether SQL is available. If you do receive spam from your form, adding a CAPTCHA is more effective at reducing or completely eliminating spam. Another less cumbersome method for site visitor's is simply to add a required checkbox will a label of something like "I'm a human" since spammer's robots will frequently not figure out they need to check the checkbox in order to get the form to submit.
There's nothing Muse can do to avoid a restriction on the server that prevents specific e-mail addresses from being sent to, short of providing or connecting to a completely different e-mail processing service than what's provided with your hosting. We may provide that option at some point in the future (for other reasons), but that's not an option right now.
If GoDaddy's support continues to point at Muse when told that sending to e-mail addresses not on the site's domain works fine and sending to addresses on the site's domain does not, and also told there's absolutely no difference in the PHP code for the two cases, then send me an e-mail and we'll talk to GoDaddy together. [email protected] -
Sending mail via forms no longer working
Recently, on one of our servers (XServe G4 - 10.3.9) was running both web and mail. Mail was moved off of the server 2 days ago onto a newer server (10.4.7)
The web server has: php4.3.11 and is ONLY running AFP/OD/Web
Since the transfer of the mail server to the new machine, all web sites can no longer send mail via their scripts (either by sendmail, php's mail(), or by connecting to SMTP server via php).
The web logs do not show errors when it attempts to send the mail...
A look at mail.log shows
"relay=cyrus, delay=2558, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: Connection refused_ 421 4.3.0 deliver: couldn't connect to lmtpd_)
As far as I'm aware, the web server/sendmail shouldn't be attempting to use cyrus at all. For the record, Cyrus master is not running.
All users can access the mail server without any difficulty. DNS entries have been checked and double checked.
Does anyone know why sendmail and php mail functions stopped working? I really need to get these web forms functioning again. Is the problem with apache, php, sendmail or something else?Hi Camelot,
Thanks for the quick reply and useful suggestion. I did as you mentioned and fired up the mail server.
The mail "delivered" however, I notice a couple issues in the logs (mail.log)
issue #1: I have to start cyrus master manually via > sudo /usr/bin/cyrus/bin/master SA and command line start/stop of mail does not start master. Also, when starting master from command line as mentioned, terminal hangs.
issue #2 (from mail.log) - still getting the same lmtpd error (but messages do finally get delivered):
Jan 14 03:58:24 www postfix/pipe[2914]: 3503858502D: to=<[email protected]>, relay=cyrus, delay=5327, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: Connection refused_ 421 4.3.0 deliver: couldn't connect to lmptd_ )
Jan 14 03:59:39 www postfix/cleanup[2906]: B60AE58572B: to=<[email protected]>, relay 123.123.123.123[123.123.123.123], delay=0, status=sent (250 Ok: queued as 9FBF41BCBCA)
Do you think these are "issues" to contend with or are they "normal" occurances? -
Which system does Muse use to make the contact form widget work?
Hello,
I am a graphic designer working with a coder to create a new website using Muse. My coder has asked me which system does Muse use to make the contact form widget work. Looking at the page code it looks like ASP dot net and when the user clicks the button the form data is sent to a script called “FormProcessv2.aspx”. If this is the case which version? (e.g. ASP 1.0 or 2.0 or 3.0) Does Muse use “dot net” or “.NET” or similar in the documentation? If so then does it say which version (e.g. 1.0 or 2.0)?
Can anyone help me with these questions?
Many Thanks
EmmaIt's unclear what page URL/code you're looking at? Muse does not use ASP. Muse uses PHP for form processing and relies on PHP sendMail to send the form information as an e-mail.
-
Hi Guys,
I have setup all the fields for my feedback form, titled them
and ID'd them, but how go I send the inpuuted information from the
form from my site to my email when the "Submit" buttin has been
hit???
Many thanks in advance on any help you may be able to
give.Hi, you will need a server side script which will process the
posted input, and handle the mail function. You may want to check
this
http://www.chauy.com/2005/11/php-sendmail-tutorial/
sendmail related tutorial. -
Impossible to send an email with Mac OS X, apache 1.3, php and sendmail
I want to use my MacMini as Web Werver and I want to send an email using php by the mail() function. But it doesn't work. What must I do ?
Please help me !Here is procedure to do working an email (in french) :
Email envoyé par la fonction mail() de php sous Mac OS X avec votre serveur web perso sous apache.
Si vous n'arrivez pas à envoyer un email par php à un destinataire, il peut y avoir au moins deux raisons :
- une erreur dans le codage de la fonction mail( ) (voir pour cela : http://fr.php.net/manual/fr/function.mail.php)
- un problème dans l'utilisation par php de sendmail (expliqué dans http://fr.php.net/manual/fr/ref.mail.php). Et comme la doc n'est pas explicite, vous allez ici comprendre ce qu'il faut faire. Deux jours de travail pour en arriver là à un ignorant du programme Terminal de Mac OS X, de sudo, et tout le reste... !
Pour que cela fonctionne il faut modifier deux fichiers :
Pour cela, sauvegardez d'abord le fichier /etc/postfix/main.cf en en faisant une copie. Pour cela, vous pouvez faire :
sudo pico /etc/postfix/main.cf
puis mettre un espace n'importe où où cela est possible, puis CTRL X, ajoutez un caractère ou deux au nom du fichier, puis Y.
Pour modifier ensuite le premier fichier, faites à nouveau :
sudo pico /etc/postfix/main.cf
et ajoutez la ligne :
myhostname = nomdedomainevalide.com
à mettre après :
# INTERNET HOST AND DOMAIN NAMES
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
Enregistrez (CTRL X, puis Y)
Ce nom de domaine que vous devez ajouter doit être valide et ne pas être le même que celui que vous allez mettre dans le deuxième fichier à modifier. Pour cela faites une sauvegarde comme précédemment pour le fichier main.cf, puis tapez à nouveau :
sudo pico /usr/local/php5/lib/php.ini
Ajoutez la ligne :
sendmail_path = /usr/sbin/sendmail -t -i -f adressevalide@nomdedomainevalide
que vous mettez après :
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = [email protected]
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
Puis enfin, enregistrer (CTRLX, puis Y)
Je répète qu'il est impératif que le nom de domaine de l'adresse email ne soit pas le même que celui placé dans le premier fichier main.cf. Par ailleurs l'adresse email doit être valide pour être acceptée comme telle par celui qui reçoit votre message. Il vaut mieux que cette adresse soit votre adresse car elle ne sert qu'à vous envoyer des messages d'erreur envoyés par sendmail si jamais il y avait une erreur bien sûr !!! Le programme sendmail étant situé dans le path donné ci-dessus : /usr/sbin.
Si cela ne fonctionne pas, vous pouvez debugger en faisant :
sudo pico /var/log/mail.log
cela vous permet de comprendre ce qui se passe chaque fois que vous envoyez par php un email.
La procédure indiquée fonctionne avec Mac OS X.4.8, apache 1.3 et php 5.2.0
Good Luck! -
Hello,
I'm trying to do a sendmail.php - I looked at this site for
advice - so I pretty much copy & pasted the code from it;
http://www.codetricks.com/article.php?cat=phpmysql&id=11
Having followed the instructions, it seems to have worked,
i.e. gives me the "Thank You" page after sending etc... but I don't
recieve an email - nor does the person sending the message.
Additionally, when I try and click in the boxes to enter the
details (Name, Email and Message) - the curser will only go in the
box if I click the very left hand side - weird?
My site is;
http://www.photographic-repair.com/html_files/contact.html
Can you suggest why it won't work? I'm also looking to add a
feature that will allow the user to upload a photo, which will be
sent to me at the same time as their message - can anyone recommend
how to incorporate this??
Thanks in advance
BenBenjohnson20 wrote:
> Hello,
>
> I'm trying to do a sendmail.php - I looked at this site
for advice - so I
> pretty much copy & pasted the code from it;
>
> <a target=_blank class=ftalternatingbarlinklarge
> href="
http://www.codetricks.com/article.php?cat=phpmysql&id=11">http://www.codet
> ricks.com/article.php?cat=phpmysql&id=11</a>
>
> Having followed the instructions, it seems to have
worked, i.e. gives me the
> "Thank You" page after sending etc... but I don't
recieve an email - nor does
> the person sending the message.
Have you uploaded the two pages to your server or are you
testing them
locally ie (not uploading them)
I tested out the files on the page you mentioned and they
didnt work on
my local server but they worked fine when I uploaded to my
remote server.
Maybe you are looking for
-
Data elements for IDoc Segments to non-SAP system
Hi, I need to create IDocs for transferring data to non-SAP system. When I create segmet fields should I create new data elements for all the fields with attributes specific to receiving system? Because there are many fields where the field attribute
-
Convoluted question about watching DVDs on TV using Mac Mini
I bought a third-party external DVD player/burner to use with my late 2012 Mac Mini. I recently moved back to the UK from the US. Of course they are different DVD regions. Before I left the US I was able to watch any region DVD and switch between t
-
Import VPN admin certificate from RV016 to RV042
Hello, I've configured VPN to use quickVPN for RV016. The VPN connection works fine. I'm going to install the second SB router RV042 in the same location in order the users should use RV042 instead of RV016. My Question is, is it possible to export t
-
Modifying many signatures at once
I have over 65 signatures set up in my Mail account. Recently I had to make a change that affected all of my signatures. I needed to replace one line in my signature with a new modified line. Is there a way to modify all 65 of my signatures at once r
-
HT1695 what do I do when my phone says no wi-fi but the wi-fi in my house is on?
Today when I got home my wi-fi didnt seem to connect like it always does so I tried to do it myself. When I did it took almost 15minutes to load and after that I gave up so I turned my whole iphone off. After that I tried to connect again but this ti