mail() vs wp_mail ... Is this coding right?

Discussion in 'PHP' started by adsensediva, Oct 17, 2009.

  1. #1
    Hi everyone,

    I'm using a wp template that allows wp to run a job posting site. Part of the template functionality is that the user (job poster) is supposed to receive an email after posting the job listing. Jobpress

    My host does not have mail() enabled so I had to use a plugin for smtp mail processing. Now that I know that it can mail out, the template still does not process the php mail call.

    Can someone take a look at this to see if there is something obviously wrong?

    <?php
    				
    				if ( get_option('successmail') == "Enable" && get_option('publish') == "On" ) {
    				
    				$subject = get_option('mailsubject');
    				
    								
    				$name = $_POST['address_name'];
    				$name = str_replace("+", " ", $name);
    				$websitename = get_bloginfo('name');
    				
    				
    				
    				$message = get_option('mailcontent');
    				$message = str_replace("[buyer_name]", "$name", $message);
    				$message = str_replace("[website_name]", "$websitename", $message);
    				
    				wp_mail($mail, $subject, $message); }
    				
    				?>
    Code (markup):
    Thanks in advance
     
    adsensediva, Oct 17, 2009 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    mastermunj, Oct 18, 2009 IP