Convert PHP Email Code to Using SMTP Authentication
One of my contact forms no longer is able to send (it used to until some server updates were made), for it keeps posting the following error:
Warning: mail() [function.mail]: SMTP server response: 501 5.1.7 Invalid address in C:\contact.php on line 71
This form does work on three other servers, so obviously the form is in working order but not on this particular server.
I was recommended to "set the PHP script up to log in to the SMTP server" using this example:
http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
I've only gotten this far and cannot figure out how to actually create it to SEND:
<?php
// set flag to indicate whether mail has been sent
$mailSent = false;
if (array_key_exists('eList', $_POST)) {
// mail processing script
// remove escape characters from POST array
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
$_POST = array_map('stripslashes_deep', $_POST);
$email = $_POST['email'];
// check for valid email address
$pattern = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
if (!preg_match($pattern, trim($email))) {
$error['email'] = 'Please enter a valid email address';
// validate the input, beginning with name
$name = trim($_POST['name']);
if (empty($name)) {
$error['name'] = 'Please enter your First Name';
$lname = trim($_POST['lname']);
if (empty($lname)) {
$error['lname'] = 'Please enter your Last Name';
$department = $_POST['department'];
if ($_POST['department'] == '') {
$error['department'] = 'Please select a Department';
// check the content of the text area
$messageBody = trim($_POST['message']);
if (empty($messageBody)) {
$error['message'] = 'Please enter your message';
// initialize variables
if (!empty($_POST['url'])) {
$to = '[email protected]';//
$subject = 'Suspected as SPAM';
$host = 'smptout.serverserver.net';
$username = 'username';
$password = 'password';
} else {
$to = '[email protected]';//
$subject = 'Here we are';
$host = 'smptout.serverserver.net';
$username = 'username';
$password = 'password';
$SpamErrorMessage = "No URLs permitted";
if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$lname")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$messageBody")) {echo "$SpamErrorMessage"; exit();} // check for spam
//build the message
$smtp = Mail::factory('smtp',
array('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$message = "To: $department\r\n\r\n";
$message .= "From: $name $lname\r\n";
$message .= "$email\r\n\r\n";
$message .= "Question/Comment: $messageBody";
//build the additional headers
$additionalHeaders = "From: Contact <[email protected]>\r\n";
$additionalHeaders .= "Reply-To: $email";
//send the email if there are not errors
if (!isset($error)) {
$mailSent = mail($to, $subject, $message, $additionalHeaders);
// check that the mail was sent successfully
if (!$mailSent) {
$error['notSent'] = 'Sorry, there was a problem sending your mail. Please try later.';
?>
Thank you for your help!
Anyone?
Similar Messages
-
Send email from SAP using SMTP-AUTH
Dear all,
I would like to send email from SAP to external SMTP server using authenticated method.
Can I set up this scenario with SAPConnect?
Or are there any other methods to set up this scenario?
Thanks, Regards,
FendhyHi,
You dont need anu authentication to be set :
Just follow below steps :
Simple steps to do the SMTP configuration :
1. Use transaction SCOT
3. Double Click on SMTP
4. You will get a window and fill in description
5. Tick the "Node in use" box
6. Enter the hostname of the email exchange server
7. Mail port will be 25
8. Click on the button next to Internet called "Set"
9. You will get another window, in the "address area" box, enter *
10. Click the green check button to exit the second window
11. Click the green check button to exit the main window
12. From top menu: Settings -> Default Domain
13. in the small box that appears enter the domain name which is the last part after the @ sign. The domain name would be company.com
14. You need to define a job to process the email, from top menu: View -> Jobs
15. From top menu: Job -> Create
16. Enter a name
17. Click on "INT" in the list then "Schedule job" button
18. Enter start date and time, then click on "Schedule Periodically" button
19. Enter something like every 10 minutes.
20. the configuration is now complete. To test it, you need to have an email defined in your user id properties. Use SU01 for that.
21. Use transaction SO00
22. Put Title, and text in the body, then enter your email address below, the recepient type would be "internet address"
23. After a maximum of 10 minutes you should get the email address.
Regards,
Nirmal.K -
Lost SMTP Authentication along the way
At work we have our OS X mail server set to require smtp authentication. This works from within the network. However, once you go off the network, you can no longer send mail if you use smtp authentication. If you set up your smtp settings to not use authentication however, it works fine. This is a huge security hole for us. What could possibly be causing this?
I am able to send to my own email domain without authentication, but am unable to send from off my domain, to off my domain with or without authentication. Here is my postconf -n
alias_maps = hash:/etc/aliases,hash:/var/mailman/data/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debugpeerlevel = 2
enableserveroptions = yes
html_directory = no
inet_interfaces = all
localrecipientmaps = proxy:unix:passwd.byname $alias_maps
luser_relay =
mail_owner = postfix
mailboxsizelimit = 0
mailbox_transport = cyrus
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mapsrbldomains =
messagesizelimit = 0
mydestination = $myhostname,localhost.$mydomain,list.solon.k12.ia.us,solon.k12.ia.us,localhost
mydomain = solon.k12.ia.us
mydomain_fallback = localhost
myhostname = solon.k12.ia.us
mynetworks = 127.0.0.0/8
mynetworks_style = host
newaliases_path = /usr/bin/newaliases
ownerrequestspecial = no
queue_directory = /private/var/spool/postfix
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
sample_directory = /usr/share/doc/postfix/examples
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpdclientrestrictions = permit_mynetworks rejectrblclient sbl-xbl.spamhaus.org rejectrblclient relays.ordb.org rejectrblclient list.dsbl.org permit
smtpdpw_server_securityoptions = login
smtpdrecipientrestrictions = permitsasl_authenticated,permit_mynetworks,reject_unauthdestination,permit
smtpdsasl_authenable = yes
smtpdtls_keyfile =
smtpduse_pwserver = yes
unknownlocal_recipient_rejectcode = 550
virtualmailboxdomains =
virtual_transport = virtual -
How SYS.UTL_MAIL SMTP authentication
I am generating some email from oracle database for finding oracle dataguard status
its generating email successfully (working), mailserver (SMTP) configured changed - Authentication required (user/pass) for sendign email .
when its execute following showing errors
Any one can guide how i can use SMTP authentication comands.
Details ORA-29279: SMTP permanent error: 550 [email protected] must check for new mail first ORA-06512: at "SYS.UTL_SMTP", line 20 ORA-06512: at "SYS.UTL_SMTP", line 98 ORA-06512: at "SYS.UTL_SMTP", line 240 ORA-06512: at "SYS.UTL_MAIL", line 405 ORA-06512: at "SYS.UTL_MAIL", line 599 ORA-06512: at "dba.DATAGUARD", line 9 ORA-06512: at line 2
DECLARE
primarydb varchar2(75);
logicaldb varchar2(75);
physicaldb varchar2(75);
BEGIN
select count(*) into primarydb from accounts.trand@primarydb;
select count(*) into logicaldb from accounts.trand@logicaldb;
select count(*) into physicaldb from accounts.trand@physicaldb;
utl_mail.send(
sender =>'[email protected]',
recipients=>'[email protected]',
cc =>'[email protected]',
subject =>'Database Status ? (Primary,Physical,Logical)',
message =>'Oracle Database Notification :'||utl_tcp.CRLF ||utl_tcp.CRLF ||
'PrimaryDB (ACC_TRAND): '||primarydb||utl_tcp.CRLF||
'LogicalDB (ACC_TRAND): '||logicaldb||utl_tcp.CRLF||
'PhysicalDB (ACC_TRAND): '||logicaldb||utl_tcp.CRLF||utl_tcp.CRLF||
'This alert just for DBA for finding data guard status, such as database running on all nodes working and data is being writing on all parallel servers correctly. Alert generated at ' ||to_char(sysdate,'dd-mm-yyyy hh:mi AM')||utl_tcp.CRLF);
END;Hi.
Look at the thread
ORA-29279: SMTP permanent error: 500 5.3.3 Unrecognized command
From the thread.
If UTL_SMTP fails with a SMTP error, it means that the mail server itself reported an error.
Regards, -
XML queries... Change the code from using Oracle db into MS SQL
Hi, I am a new begginer in this field. I came accross to an article that focuses in Oracle's XSU approach.
Currently, i am trying to convert the java code from using Oracle db to MSSQL db. The code has shown below:
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
import oracle.xml.sql.query.*;
public class testxml
public static void main(String args[]) throws SQLException, NamingException
String tabName = "emp";
int maxRows = 3;
Context ctx = new InitialContext ();
DataSource ds = (DataSource) ctx.lookup ("MyOra");
Connection conn = ds.getConnection ();
OracleXMLQuery qu = new OracleXMLQuery (
conn, "select EMPNO, ENAME from " + tabName);
qu.setMaxRows (maxRows);
qu.setRowsetTag ("EMPLOYERS");
qu.setRowTag ("PERSON");
String xmlString = qu.getXMLString();
System.out.println (xmlString);
conn.close ();
Currently, i am having difficulties to change the "bold" area that uses Oracle into MS SQL as my current application is using MS SQL as the database.
Please help and need more advices from all of you. Thank YouI resolved this issue myself. For the answer please message me.
-
Webserver on DMZ cannot send email via php script using SMTP (cisco firewall pix 515e)
Hello,
I have two web servers that are sitting in a DMZ behind a Cisco Firewall PIX 515e. The webservers appear to be configured correctly as our website and FTP website are up. On two of our main website, we have two contact forms that use a simple html for to call a php script that uses smtp as its mailing protocol. Since, I am not the network administrator, I don't quite understand how to read the current configurations on the firewall, but I suspect that port 25 is blocked, which prevents the script from actually working or sending out emails. What I've done to narrow the problem done is the following: I used a wamp server to test our scripts with our smtp servers settings, was able to successfully send an email out to both my gmail and work place accounts. Currently, we have backupexec loaded on both of these servers, and when I try to send out an alert I never receive it. I think because port 25 is closed on both of those servers. I will be posting our configuration. if anyone can take a look and perhaps explain to me how I can change our webservers to communicate and successfully deliver mail via that script, I would gladly appreciate it. our IP range is 172.x.x.x, but it looks like our webservers are using 192.x.x.x with NAT in place. Please someone help.
Thanks,
Jeff Mateo
PIX Version 6.3(4)
interface ethernet0 100full
interface ethernet1 100full
interface ethernet2 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
nameif ethernet2 DMZ security50
enable password GFO9OSBnaXE.n8af encrypted
passwd GFO9OSBnaXE.n8af encrypted
hostname morrow-pix-ct
domain-name morrowco.com
clock timezone EST -5
clock summer-time EDT recurring
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
no fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
name 12.42.47.27 LI-PIX
name 172.20.0.0 CT-NET
name 172.23.0.0 LI-NET
name 172.22.0.0 TX-NET
name 172.25.0.0 NY-NET
name 192.168.10.0 CT-DMZ-NET
name 1.1.1.1 DHEC_339849.ATI__LEC_HCS722567SN
name 1.1.1.2 DHEC_339946.ATI__LEC_HCS722632SN
name 199.191.128.105 web-dns-1
name 12.127.16.69 web-dns-2
name 12.3.125.178 NY-PIX
name 64.208.123.130 TX-PIX
name 24.38.31.80 CT-PIX
object-group network morrow-net
network-object 12.42.47.24 255.255.255.248
network-object NY-PIX 255.255.255.255
network-object 64.208.123.128 255.255.255.224
network-object 24.38.31.64 255.255.255.224
network-object 24.38.35.192 255.255.255.248
object-group service morrow-mgmt tcp
port-object eq 3389
port-object eq telnet
port-object eq ssh
object-group network web-dns
network-object web-dns-1 255.255.255.255
network-object web-dns-2 255.255.255.255
access-list out1 permit icmp any any echo-reply
access-list out1 permit icmp object-group morrow-net any
access-list out1 permit tcp any host 12.193.192.132 eq ssh
access-list out1 permit tcp any host CT-PIX eq ssh
access-list out1 permit tcp any host 24.38.31.72 eq smtp
access-list out1 permit tcp any host 24.38.31.72 eq https
access-list out1 permit tcp any host 24.38.31.72 eq www
access-list out1 permit tcp any host 24.38.31.70 eq www
access-list out1 permit tcp any host 24.38.31.93 eq www
access-list out1 permit tcp any host 24.38.31.93 eq https
access-list out1 permit tcp any host 24.38.31.93 eq smtp
access-list out1 permit tcp any host 24.38.31.93 eq ftp
access-list out1 permit tcp any host 24.38.31.93 eq domain
access-list out1 permit tcp any host 24.38.31.94 eq www
access-list out1 permit tcp any host 24.38.31.94 eq https
access-list out1 permit tcp any host 24.38.31.71 eq www
access-list out1 permit tcp any host 24.38.31.71 eq 8080
access-list out1 permit tcp any host 24.38.31.71 eq 8081
access-list out1 permit tcp any host 24.38.31.71 eq 8090
access-list out1 permit tcp any host 24.38.31.69 eq ssh
access-list out1 permit tcp any host 24.38.31.94 eq ftp
access-list out1 permit tcp any host 24.38.31.92 eq 8080
access-list out1 permit tcp any host 24.38.31.92 eq www
access-list out1 permit tcp any host 24.38.31.92 eq 8081
access-list out1 permit tcp any host 24.38.31.92 eq 8090
access-list out1 permit tcp any host 24.38.31.93 eq 3389
access-list out1 permit tcp any host 24.38.31.92 eq https
access-list out1 permit tcp any host 24.38.31.70 eq https
access-list out1 permit tcp any host 24.38.31.74 eq www
access-list out1 permit tcp any host 24.38.31.74 eq https
access-list out1 permit tcp any host 24.38.31.74 eq smtp
access-list out1 permit tcp any host 24.38.31.75 eq https
access-list out1 permit tcp any host 24.38.31.75 eq www
access-list out1 permit tcp any host 24.38.31.75 eq smtp
access-list out1 permit tcp any host 24.38.31.70 eq smtp
access-list out1 permit tcp any host 24.38.31.94 eq smtp
access-list dmz1 permit icmp any any echo-reply
access-list dmz1 deny ip any 10.0.0.0 255.0.0.0
access-list dmz1 deny ip any 172.16.0.0 255.240.0.0
access-list dmz1 deny ip any 192.168.0.0 255.255.0.0
access-list dmz1 permit ip any any
access-list dmz1 deny ip any any
access-list nat0 permit ip CT-NET 255.255.0.0 192.168.220.0 255.255.255.0
access-list nat0 permit ip host 172.20.8.2 host 172.23.0.2
access-list nat0 permit ip CT-NET 255.255.0.0 LI-NET 255.255.0.0
access-list nat0 permit ip CT-NET 255.255.0.0 NY-NET 255.255.0.0
access-list nat0 permit ip CT-NET 255.255.0.0 TX-NET 255.255.0.0
access-list vpn-split-tun permit ip CT-NET 255.255.0.0 192.168.220.0 255.255.255
.0
access-list vpn-split-tun permit ip CT-DMZ-NET 255.255.255.0 192.168.220.0 255.2
55.255.0
access-list vpn-dyn-match permit ip any 192.168.220.0 255.255.255.0
access-list vpn-ct-li-gre permit gre host 172.20.8.2 host 172.23.0.2
access-list vpn-ct-ny permit ip CT-NET 255.255.0.0 NY-NET 255.255.0.0
access-list vpn-ct-ny permit ip CT-DMZ-NET 255.255.255.0 NY-NET 255.255.0.0
access-list vpn-ct-tx permit ip CT-NET 255.255.0.0 TX-NET 255.255.0.0
access-list vpn-ct-tx permit ip CT-DMZ-NET 255.255.255.0 TX-NET 255.255.0.0
access-list static-dmz-to-ct-2 permit ip host 192.168.10.141 CT-NET 255.255.248.
0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 192.168.220.0 255.255.25
5.0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 LI-NET 255.255.0.0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 NY-NET 255.255.0.0
access-list nat0-dmz permit ip CT-DMZ-NET 255.255.255.0 TX-NET 255.255.0.0
access-list static-dmz-to-ct-1 permit ip host 192.168.10.140 CT-NET 255.255.248.
0
access-list static-dmz-to-li-1 permit ip CT-DMZ-NET 255.255.255.0 CT-NET 255.255
.248.0
access-list vpn-ct-li permit ip CT-NET 255.255.0.0 LI-NET 255.255.0.0
access-list vpn-ct-li permit ip CT-DMZ-NET 255.255.255.0 LI-NET 255.255.0.0
access-list vpn-ct-li permit ip host 10.10.2.2 host 10.10.1.1
access-list in1 permit tcp host 172.20.1.21 any eq smtp
access-list in1 permit tcp host 172.20.1.20 any eq smtp
access-list in1 deny tcp any any eq smtp
access-list in1 permit ip any any
access-list in1 permit tcp any any eq smtp
access-list cap4 permit ip host 172.20.1.82 host 192.168.220.201
access-list cap2 permit ip host 172.20.1.82 192.168.220.0 255.255.255.0
access-list in2 deny ip host 172.20.1.82 any
access-list in2 deny ip host 172.20.1.83 any
access-list in2 permit ip any any
pager lines 43
logging on
logging timestamp
logging buffered notifications
logging trap notifications
logging device-id hostname
logging host inside 172.20.1.22
mtu outside 1500
mtu inside 1500
mtu DMZ 1500
ip address outside CT-PIX 255.255.255.224
ip address inside 172.20.8.1 255.255.255.0
ip address DMZ 192.168.10.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
ip local pool ctpool 192.168.220.100-192.168.220.200
ip local pool ct-thomson-pool-201 192.168.220.201 mask 255.255.255.255
pdm history enable
arp timeout 14400
global (outside) 1 24.38.31.81
nat (inside) 0 access-list nat0
nat (inside) 1 CT-NET 255.255.0.0 2000 10
nat (DMZ) 0 access-list nat0-dmz
static (inside,DMZ) CT-NET CT-NET netmask 255.255.0.0 0 0
static (inside,outside) 24.38.31.69 172.20.8.2 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.94 192.168.10.141 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.71 172.20.1.11 dns netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.93 192.168.10.140 netmask 255.255.255.255 0 0
static (DMZ,inside) 24.38.31.93 access-list static-dmz-to-ct-1 0 0
static (DMZ,inside) 24.38.31.94 access-list static-dmz-to-ct-2 0 0
static (inside,outside) 24.38.31.92 172.20.1.56 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.91 192.168.10.138 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.90 192.168.10.139 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.72 172.20.1.20 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.73 172.20.1.21 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.70 172.20.1.91 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.88 192.168.10.136 netmask 255.255.255.255 0 0
static (DMZ,outside) 24.38.31.89 192.168.10.137 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.74 172.20.1.18 netmask 255.255.255.255 0 0
static (inside,outside) 24.38.31.75 172.20.1.92 netmask 255.255.255.255 0 0
access-group out1 in interface outside
access-group dmz1 in interface DMZ
route outside 0.0.0.0 0.0.0.0 24.38.31.65 1
route inside 10.10.2.2 255.255.255.255 172.20.8.2 1
route inside CT-NET 255.255.248.0 172.20.8.2 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
aaa-server ct-rad protocol radius
aaa-server ct-rad max-failed-attempts 2
aaa-server ct-rad deadtime 10
aaa-server ct-rad (inside) host 172.20.1.22 morrow123 timeout 7
aaa authentication ssh console LOCAL
aaa authentication http console LOCAL
aaa authentication serial console LOCAL
aaa authentication telnet console LOCAL
http server enable
http 173.220.252.56 255.255.255.248 outside
http 65.51.181.80 255.255.255.248 outside
http 208.65.108.176 255.255.255.240 outside
http CT-NET 255.255.0.0 inside
no snmp-server location
no snmp-server contact
snmp-server community m0rroW(0
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
sysopt connection permit-pptp
crypto ipsec transform-set 3des-sha esp-3des esp-sha-hmac
crypto ipsec transform-set 3des-md5 esp-3des esp-md5-hmac
crypto dynamic-map dyn_map 20 match address vpn-dyn-match
crypto dynamic-map dyn_map 20 set transform-set 3des-sha
crypto map ct-crypto 10 ipsec-isakmp
crypto map ct-crypto 10 match address vpn-ct-li-gre
crypto map ct-crypto 10 set peer LI-PIX
crypto map ct-crypto 10 set transform-set 3des-sha
crypto map ct-crypto 15 ipsec-isakmp
crypto map ct-crypto 15 match address vpn-ct-li
crypto map ct-crypto 15 set peer LI-PIX
crypto map ct-crypto 15 set transform-set 3des-sha
crypto map ct-crypto 20 ipsec-isakmp
crypto map ct-crypto 20 match address vpn-ct-ny
crypto map ct-crypto 20 set peer NY-PIX
crypto map ct-crypto 20 set transform-set 3des-sha
crypto map ct-crypto 30 ipsec-isakmp
crypto map ct-crypto 30 match address vpn-ct-tx
crypto map ct-crypto 30 set peer TX-PIX
crypto map ct-crypto 30 set transform-set 3des-sha
crypto map ct-crypto 65535 ipsec-isakmp dynamic dyn_map
crypto map ct-crypto client authentication ct-rad
crypto map ct-crypto interface outside
isakmp enable outside
isakmp key ******** address LI-PIX netmask 255.255.255.255 no-xauth no-config-mo
de
isakmp key ******** address 216.138.83.138 netmask 255.255.255.255 no-xauth no-c
onfig-mode
isakmp key ******** address NY-PIX netmask 255.255.255.255 no-xauth no-config-mo
de
isakmp key ******** address TX-PIX netmask 255.255.255.255 no-xauth no-config-mo
de
isakmp identity address
isakmp nat-traversal 20
isakmp policy 10 authentication pre-share
isakmp policy 10 encryption 3des
isakmp policy 10 hash sha
isakmp policy 10 group 2
isakmp policy 10 lifetime 86400
isakmp policy 20 authentication pre-share
isakmp policy 20 encryption 3des
isakmp policy 20 hash md5
isakmp policy 20 group 2
isakmp policy 20 lifetime 86400
isakmp policy 30 authentication pre-share
isakmp policy 30 encryption 3des
isakmp policy 30 hash md5
isakmp policy 30 group 1
isakmp policy 30 lifetime 86400
vpngroup remotectusers address-pool ctpool
vpngroup remotectusers dns-server 172.20.1.5
vpngroup remotectusers wins-server 172.20.1.5
vpngroup remotectusers default-domain morrowny.comAmit,
I applaud your creativity in seeking to solve your problem, however, this sounds like a real mess in the making. There are two things I don't like about your approach. One, cron -> calling Java -> calling PHP -> accessing database, it's just too many layers, in my opinion, where things can go wrong. Two it seems to me that you are exposing data one your website (with the PHP) that you may not want expose and this is an important consideration when you are dealing with emails and privacy and so on.
I think the path of least resistance would be to get a new user account added to the MySQL database that you can access remotely with your Java program. This account can be locked down for read only access and be locked down to the specific IP or IP range that your Java program will be connecting from.
Again I applaud your creativity but truly this seems like a hack because of the complexity and security concerns you are introducing and I think is a path to the land of trouble. Hopefully you will be able to get a remote account set up. -
SMTP Authentication for PHP Mail
Can anyone help me in figuring out the correct way to incorporate the SMTP authentication into a form? I am having a lot of trouble in getting my forms to send with this format. My code for my php action page is below. I have my correct information where i included *******. Please let me know what i have wrong.
CODE STARTS HERE
<?php
//new function
$to = "*******";
$nameto = "LTL Freight Shop";
$from = "*******";
$namefrom = "LTL Freight Shop";
$subject = "Account Request";
authSendEmail($from, $namefrom, $to, $nameto, $subject, $message);
?>
<?php
$recipient = "*******";
//$subject = "Account Request";
$companyname = check_input($_POST['CompanyName'], "Enter your company name");
$firstname = check_input($_POST['FirstName'], "Enter your first name");
$lastname = check_input($_POST['LastName'], "Enter your last name");
$phone = check_input($_POST['PhoneNumber'], "Enter your phone number");
$fax = check_input($_POST['FaxNumber']);
$email = check_input($_POST['Email'], "Enter your email");
$address = check_input($_POST['StreetAddress'], "Enter your address");
$city = check_input($_POST['City'], "Enter your city");
$state = check_input($_POST['State'], "Enter your state");
$zipcode = check_input($_POST['ZipCode'], "Enter your zip code");
$country = check_input($_POST['Country'], "Enter your country");
$yearsinbusiness = check_input($_POST['YearsinBusiness'], "Enter your years in business");
$typeofindustry = check_input($_POST['TypeofIndustry'], "Enter your type of industry");
$multiplelocations = check_input($_POST['MultipleLocations']);
$numberoflocations = check_input($_POST['LocationsCount']);
$ltl = check_input($_POST['ServicesLTL']);
$ftl = check_input($_POST['ServicesFTL']);
$domesticparcel = check_input($_POST['ServicesDomesticParcel']);
$intlparcel = check_input($_POST['ServicesInternationalParcel']);
$airfreight = check_input($_POST['ServicesAirFreight']);
$oceanfreight = check_input($_POST['ServicesOceanFreight']);
$other = check_input($_POST['ServicesOther']);
$none = check_input($_POST['ServicesNone']);
$volume = check_input($_POST['TypicalVolume'], "Enter your typical volume");
$carrier = check_input($_POST['CurrentCarrier'], "Enter your current carrier");
$class = check_input($_POST['AverageClass'], "Enter your average class");
$weight = check_input($_POST['AverageWeight'], "Enter your average weight");
$process = check_input($_POST['Process']);
$hearabout = check_input($_POST['HearAbout']);
$comments = check_input($_POST['Comments']);
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
show_error("E-mail address not valid");
$message = "You have received an account request from:
Company Name: $companyname
First Name: $firstname
Last Name: $lastname
Phone Number: $phone
Fax Number: $fax
E-mail: $email
Street Address: $address
City: $city
State: $state
Zip Code: $zipcode
Country: $country
Years in Business: $yearsinbusiness
Type of Industry: $typeofindustry
Multiple Locations: $multiplelocations
Number of Locations: $numberoflocations
Services they use: $ltl, $ftl, $domesticparcel, $intlparcel, $airfreight, $oceanfreight, $other, $none
Typical Volume: $volume
Current Carrier: $carrier
Average Class: $class
Average Weight: $weight
How they currently process: $process
How they heard about us: $hearabout
Comments: $comments
End of message
//ini_set("SMTP","smtp.emailsrvr.com");
//ini_set("SMTP_PORT", 25);
//ini_set("sendmail_from","*******");
//mail($recipient, $subject, $message);
function check_input($data, $problem='')
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
show_error($problem);
return $data;
function authSendEmail($from, $namefrom, $to, $nameto, $subject, $message)
$smtpServer = "smtp.emailsrvr.com";
$port = "25";
$timeout = "30";
$username = "********";
$password = "********";
$localhost = "smtp.emailsrvr.com";
$newLine = "\r\n";
$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
$smtpResponse = fgets($smtpConnect, 515);
if(empty($smtpConnect))
$output = "Failed to connect: $smtpResponse";
return $output;
else
$logArray['connection'] = "Connected: $smtpResponse";
fputs($smtpConnect,"AUTH LOGIN" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authrequest'] = "$smtpResponse";
fputs($smtpConnect, base64_encode($username) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authusername'] = "$smtpResponse";
fputs($smtpConnect, base64_encode($password) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authpassword'] = "$smtpResponse";
fputs($smtpConnect, "HELO $localhost" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['heloresponse'] = "$smtpResponse";
fputs($smtpConnect, "MAIL FROM: $from" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailfromresponse'] = "$smtpResponse";
fputs($smtpConnect, "RCPT TO: $to" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailtoresponse'] = "$smtpResponse";
fputs($smtpConnect, "DATA" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data1response'] = "$smtpResponse";
$headers = "MIME-Version: 1.0" . $newLine;
$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
$headers .= "To: $nameto <$to>" . $newLine;
$headers .= "From: $namefrom <$from>" . $newLine;
fputs($smtpConnect, "To: $to\nFrom: $from\nSubject: $subject\n$headers\n\n$message\n.\n");
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data2response'] = "$smtpResponse";
fputs($smtpConnect,"QUIT" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['quitresponse'] = "$smtpResponse";
function show_error($myError)
?>
<html>
<body>
<b>Please correct the following error:</b><br />
<?php echo $myError; ?>
</body>
</html>
<?php
exit();
?>I have the same problem - user has Outlook 2010 on Exchange 2007. Mail goes directly into the deleted items folder. After browsing around the net I found 2 different site with the same potential fix. It seems that when migrating a user from Exch 2003 to
2007 (which we did) some of the configs get set incorrectly. The weird thing is we migrated over 2 years ago, and some others are experiencing the same after a long period after the migration. The fix that was suggested is:
Go to your Exch server, open up Exchange Management Shell and type the following:
get-mailboxcalendarsettings "domain/ou/user" | fl
set-mailboxcalendarsettings "doman/ou/user" -automateprocessing: Autoupdate
My user already had Autoupdate set, but this seems to have fixed it for me... -
Why do i get an error 63 when i sent a mail use SMTP Email
I used "SMTP Email Send Message.vi" but i have allways the error 63. How can I reslove this error? Ist this a port error? a pop up displayes and shows that i should to change the option under the tool palette-> Server.Vi but Ido not know what i can do?
What SMTP server are you trying to use? Your own? Obviously, it is refusing your connection attempt. The SMTP VIs exclusively use the classic SMTP port (25), but many newer mail servers require different authentication, port, encryption, etc. for security reasons.
Start with this search.
LabVIEW Champion . Do more with less code and in less time . -
Why do i get an error 66 when i sent a mail use SMTP Email Send File.vi?
When i use SMTP Email Send File.vi,it works very well for some special mail sever such as the sever of my company,For others,while debugging it ,i use a free email address from 163 (http://mail.163.com/) or Sina(http://mail.sina.com.cn/) i get an error 66.I use the default sever port number(incoming mail sever(POP3):110,Outgoing mail sever(SMTP):25).
Server information for 163:
incoming mail sever(POP3)op3.163.com
Outgoing mail sever(SMTP):smtp.163.com
Server information for Sina:
incoming mail sever(POP3)op3.sina.com
Outgoing mail sever(SMTP):smtp.sina.com
Thank you!According to the LabVIEW documentation error code 66 is: "The network connection was closed by the peer", which is not very helpful. There could be a number of reasons why this happens. Could also be that the server was down. I had trouble connecting to one of the sites you listed. Does the server require authentication? I tried the links you provided, but they're in a foreign language and I can't read them, so I can't tell. If authentication is required, then the SMTP VIs provided with LabVIEW won't work since they don't handle authentication. If the server requires authentication you can try the updated OpenG SMTP VIs that I had posted in this thread.
-
Email a form using PHP works intermittently
Hello all,
I'm using DW CS6/ Win 7. I have created a simple subscription form where the user enters their email and the form is emailed to an administrator. Sometimes it works and sometimes it doesn't and I have no idea why. Occasionally I receive the email after a delay of several minutes and sometimes it never arrives. The webpage is here www.sanbenitoolivefestival.com/contactus2.php , below is the script , I've tried in IE and FF, same intermittent results. I'm new to FF/ Firebug but it didn't report any errors that I could see
<div class="subscribe">
<div class="spacer"></div>
<?php
if ((isset($_REQUEST['email'])) && ($_REQUEST['email'] != " Enter Email Address"))
//if "email" is filled out, send email
echo "sending mail";
//send email
$email = $_REQUEST["email"] ;
$subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
$message = "Please add my email address to the SBOF email subscription list" ;
mail("[email address removed by moderator]", $subject,
$message, "From:" . $email);
echo "Thank you, we have sent your subscription request";
else
//if "email" is not filled out, display the form
echo '<form action="contactus2.php" method="post" >
<em>Stay in touch by joining our email list.
<input name="email" type="text" value=" Enter Email Address" size="42" class="input" />
<input name="submit" type="submit" value=" SUBSCRIBE " class="button"/>
</em>
</form>';
?>
</div>You are using an extremely insecure technique that lays your form wide open to a malicious attack known as email header injection, which can turn your form into a spam relay.
You should NEVER use unfiltered form input in the email headers. The From header is intended to indicate who sent the email. In this case, it's your website, not the person who fills out the form. If you want the convenience of hitting the reply button in your email program to use the sender's email address, you should use the Reply-to header instead of From.
Misusing the From header like this is one possible cause of your emails not getting through. You should also check with your hosting company to see if they require the fifth argument to mail() to be set. This is normally a string that begins with -f followed immediately by a known email address on the same domain as the server, for example '[email protected]'.
Also, using $_REQUEST is insecure.
Change your code like this:
<?php
if ((isset($_POST['email'])) && ($_POST['email'] != " Enter Email Address"))
//if "email" is filled out, send email
// make sure the email is OK
$email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
// send the message only if the email address is valid
if ($email) {
echo "sending mail";
//send email
$from = '[email protected]'; // this should be your own email address
$subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
$message = "Please add my email address to the SBOF email subscription list" ;
$headers = "From: $from\r\nReply-to: $email";
$sent = mail("[email address removed by moderator]", $subject,
$message, $headers);
if ($sent) {
echo "Thank you, we have sent your subscription request";
} else {
echo 'Sorry, there was a problem sending your request';
else
//if "email" is not filled out, display the form
echo '<form action="contactus2.php" method="post" >
<em>Stay in touch by joining our email list.
<input name="email" type="text" value=" Enter Email Address" size="42" class="input" />
<input name="submit" type="submit" value=" SUBSCRIBE " class="button"/>
</em>
</form>';
?> -
Scan to email and sign in using network authentication - M476dw
Hi, I've at long last got almost everything set up. The printer is connected wirelessly and prints fine over the network. The scanner is able to scan to a directory on my computer. The scan to email profile is set up and tested correctly, and I have set up the Networking>Access Control to have Access Code enabled, all features set to "local device" with "device guest" checked as well.
When I try to scan from the machine to email however I get the following message:
"The Scan to Email feature is not available for use. You must sign in using network authentication (Windows or LDAP) in order to use the Scan to Email feature"
Is there really no way to scan to my email without those incomprehensible setups? And if not, does LDAP or Windows sign in require specialized equipment as well, or just to be able to wade through the jargon? If the latter, can you please point me to a clear instruction for how to set it up with terms defined, as the help file I've found was totally incomprehensible to me.Hello rkimball,
Welcome to the HP Support Forums!
I see you are having issues with the setting in Yahoo and Scan to Email on your HP printer. There is no option to enter the information Yahoo is trying to ask for within Scan to Email. Even though other Apps have worked with this, Scan to Email will not.
Regards,
JERENDS
I work on behalf of HP
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping! -
SMTP authentication for wap baesd email
Hi...
I m trying my hands on WAP based email system... I m working with javamail and servlets for the same..
The application developed so far works well except while sending mails, SMTP authentication is requred..
can some one elaborate how to handle this thru java as in while creating SMTP session smtpsession, how do we use the authentication feature....
Thnkcx
v!
More details.. this is my send mail function.
public void send(HttpServletRequest request,HttpServletResponse response, UserSessionData userSessionData)
throws ServletException, IOException, MessagingException {
try {
String from = userSessionData.getEmailAddress();
String to = request.getParameter("to");
String cc = request.getParameter("cc");
String subject = request.getParameter("subject");
String text = request.getParameter("text");
//Define message
MimeMessage message = new MimeMessage(userSessionData.getSmtpSession());
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
try {
message.addRecipient(Message.RecipientType.CC, new InternetAddress(cc));
} catch (AddressException ae) {
//Bad cc address
message.setSubject(subject);
message.setText(text);
//send message
Transport.send(message);
this.mainMenu(request, response, userSessionData);
}catch (Exception e) {
e.printStackTrace();
Any suggestions guys ?I hope this help you
//Define message
Session session = userSessionData.getSmtpSession();
MimeMessage message = new MimeMessage(session);
// Send message
Transport transport = session.getTransport("smtp");
transport.connect(HOST, MAIL_USER, MAIL_PWD);transport.sendMessage(message); -
Send Email SMTP Authentication not working
Hello,
I have the following Problem, I want to send E-mail via the Send Email Activity to Mailing Lists/Group. But the authentication doesn't work, the Exchange says I dont have the needed permissions. I have filled all the Data into Advanced -> SMTP authentication.
The strange thing it works with the same Account if it is used inside the Service Manager.
We use Exchange 2010 & Orchestrator 2012 SP1.
Regards,
JanHi,
perhaps the Runbook Service account or IP address have no rights as relay at the Exchange-SMTP (?).
I suggest to test at the Runbook Server(s) via telnet:
http://support.microsoft.com/kb/153119
Regards,
Stefan
www.sc-orchestrator.eu ,
Blog sc-orchestrator.eu -
API to Fetch email using SMTP from EXCHANGE server.
Hi There,
We have a customer requirement to fetch e-mails from his EXCHANGE server using SMTP. Our application currently supports fetching e-mail using POP, IMAP.
POP and IMAP is disabled in customer environment and there is no way enable them to fetch e-mails.
Please help me to solve this problem by pointing to some APIs available or code.
I searched but not able to find a solution for this.
Thanks in advance.
Regards,
Krish.SMTP is generally, almost strictly used for sending mail not fetching.
I understand that they may not be able to use IMAP or POP, as some rented Exchange services block IMAP,POP services so they can ensure the client is sticking to the Exchange product line etc.
Perhaps you could find a Exchange library for Java? im sure there is one about. There are OpenSource solutions for exchange out there as Linux applications like evolution can communicate with Exchange. I beilve the protocol used in Exchange is MAPI? (or SAPI?)
Another solution would be to just use the clients mail client to export the emails to a more portable format (MBOX? or a folder of EMS files) then import them into Java using InputStreams on the files?
Or, Get an opensource Exchange compatible server software, eGroupware springs to mind, set that up as a proxy or a go-between. set it up to retrieve mail from the Exchange server and enable its POP and IMAP functions and retrieve the mail from it.
Either way Im near 100% certain SMTP is not for fetching mail. -
Smtp authentication for email invites with RTC
I'm trying to configure email invitations for Real-Time conferences and am following the documentation.
Problem I'm encountering is we use smtp host authentication with Exchange but I don't see any way to set this up for RTC invites.
rtcctl> setProperty -system true -pname EmailEnabled -pvalue true
rtcctl> setProperty -system true -pname SmtpHost -pvalue "mail-net.company.com"Where do I set an SMTP username and password?
Thanks.Any comments from Oracle? Isn't anyone doing smtp authentication for outbound emails?
Maybe you are looking for
-
How to Restict number of rows to download data in excel sheet
hi, my requirement is that i m showing top 50 seller in my dashboard. but when we click on download to excel then all 500 rows are downloading. i want to restrict downloading all data and want show only displayed data of dashboard in excel sheet.(ex
-
Apple TV Completely Re-syncing Every Time I restart iTunes
After the last patch to iTunes (via Software Update), every time that I stop and start iTunes it does a full wipe of the Apple TV's hard drive and a full re-sync. Which takes almost an hour since I have over 3,000 songs. Any ideas what might be causi
-
My tv shows and films start to play but there is no picture
Can anybody offer any help please. If i play any tv shows or films in my librar, they start to play but there is no picture.
-
A recent article from TechRebulic which I subscribe to, has highlighted a security risk associated with in-App advertising on the android platform using a tool called AdRisk to automate and identify the risks with a particular App association, and co
-
Import error on XMP files when bringing in image sequences to AE cs6
Hey everyone, I'm having difficulty getting AE 6 to import my still image timelapse sequences. It throws an error called-unsupported file type extension. I did not have this problem with cs 5.5. My workflow goes as follows. -bring RAW stills into