mysql - PHP mail() function not sending on new server -


emails sent when there are some issues with a PHP script (code below). In fact, it populates a vCard file with the contact information stored in a SQL DB and connects it to an email using the PHP mail () function.

I had to work perfectly on a shared hosting server a few days ago ... but I recently migrated everything to VPS and it stopped magically working mail ( ) The truth on sending continues to return, but the actual email never comes in my inbox.

  // sendemail: Email a vcard when an email address and name function sendemail ($ address, $ scandious) {include ('../dbconnect.php'); $ Info = mysql_fetch_array (mysql_query ("Select * User Username = '" $ usernum. "" LIMIT 1 ")); $ Vcard_content =" BEGIN: VCARD \ r "; $ Vcard_content." "Version: 3.0 \ r "; $ VCard_content. =" N: ". $ Info [lname]."; "$ Info [fname]."; ;; + R "; $ vCard_content. =" Fn:. $ Info [fname] "". $ Info [lname]. "\ R"; $ Vcard_content. = "ORG:". $ Info [company]. "; \ R "; $ vCard_content. =" TITLE: "$ info [title]." \ R "; $ Vcard_content. =" EMAIL; Type = INTERNET; Type = WORK; Type = pref: ". $ Info [email]." \ R "; $ vCard_content. =" TEL; Type = work; Type = pref: ". $ Info [phone]." \ R "; $ Vcard_content. =" Item2.URL; Type = pref: ". $ Info [website]." \ R "; $ Vcard_content." "Item2.X-ABLabel: _ $! & Lt; Homepage & gt; $ VCard_content. = "X-AB ShowWays: Company \ r"; $ vCard_content. = "END: VCARD"; $ Email_subject = "Your VCard" $ info [fname] "" $ info [ Lname]; $ Fileatt_type = "app / octet-stream"; // file type $ fileatt_name = $ info [fname]. "_". $ Info [lname]. ". Vcf "; $ Header =" From: Ben@scanred.com "; $ Today = Date (" L, FJ, Y, G: I One "); $ Message =" & lt; Br / & gt; Just open the attached vCard file to view / download information & lt; Br / & gt; "; $ message. = $ Today." PST & lt; Br / & gt; & Lt; Br / & gt; "; $ message. = $ Info [name]." & Lt; $ Data = $ vcard_content; $ data = chunk_split (base 64_concode ($ data)); $ semi_read = MD5 (time); $ Mime_boundary = "== multipart_boundary_x {$ semi_rand} x "; $ Header. =" \ N MMIME-Version: 1.0 \ n "." Content-Type: Multipart / Composite; \ N "." Range = \ "{$ mime_boundary} \" "$ message. =" This is a multi-part message in MIME format. \ N \ n "." - {$ mime_boundary} \ n "." Content-Type: Text / html; "Message-transfer-encoding: 7-bit \ n \ n". $ Message "\ n \ n"; $ message. = "- {$ mime_boundary} \" N "." Content-Type: {$ fileatt_type}; "Data transfer-encoding: base64 \ n \ n". $ Data "\ n \ n". "- {$ mime_boundary} - \" \ n " N "; echo @mail ($ address, $ email_subject, $ message, $ headers); echo $ address;}    

This is probably somewhere in the queue on your server. Check your php.ini.

Just to minimize it, try a really simple mail command Do ...

Mail ("youraddress@whatever.com", "topic", "test3, 2, 1 ..."); < P> Also in your script, if there was a problem, you Unable to see from. @ disables the display of errors in the front because this truth is coming back, so I'm sure it's working properly. Mail () The function does not verify that the e-mail was successfully sent ... only if it was handed over to something else. Your sender may not match on the box. Or for Windows, your SMTP server is set correctly Can not be done.

There is always a case of e-mail sit in a spam filter anywhere.

Comments