Jump to content

Php Form Mailer Images


andyfox1987

Recommended Posts

Hi everybody, I have an issue and I'm hoping I can get some insight into the situation.  Recently I used a php form wizard to generate a form mailer for a website I designed. I've run into a wall with actually editing the script because I don't have much php scripting knowledge. The problem I'm having is that I need to insert two images into the auto-email the form sends out after it is submitted. From what I see, the form mails out into just plain text, so I can't use images. I will include the code to see if any of you can help me out with this problem. Thanks :facewall:

<?php

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'relay-hosting.secureserver.net';
$config['smtp_port'] = '25';

// Receiving variables
@$requiredName = addslashes($_POST['requiredName']);
@$EntityName = addslashes($_POST['EntityName']);
@$requiredEmail = addslashes($_POST['requiredEmail']);
@$requiredPhoneNumber = addslashes($_POST['requiredPhoneNumber']);
@$requiredAddress = addslashes($_POST['requiredAddress']);
@$requiredCity = addslashes($_POST['requiredCity']);
@$requiredState = addslashes($_POST['requiredState']);
@$requiredZipcode = addslashes($_POST['requiredZipcode']);
@$requiredFundsAmount = addslashes($_POST['requiredFundsAmount']);
@$additionalComments = addslashes($_POST['additionalComments']);
@$success = addslashes($_POST['']);
// Validation
if (strlen($requiredName) == 0 )
{
header("Location: index.html");
exit;
}

if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $requiredEmail))
{
header("Location: index.html");
exit;
}

if (strlen($requiredEmail) == 0 )
{
header("Location: index.html");
exit;
}

//Sending Email to form owner
$pfw_header = "From: $requiredEmail\n"
  . "Reply-To: $requiredEmail\n";
$pfw_subject = "Proof of Funding Results";
$pfw_email_to = "info@info.com";
$pfw_message = "requiredName: $requiredName\n"
. "EntityName: $EntityName\n"
. "requiredEmail: $requiredEmail\n"
. "requiredPhoneNumber: $requiredPhoneNumber\n"
. "requiredAddress: $requiredAddress\n"
. "requiredCity: $requiredCity\n"
. "requiredState: $requiredState\n"
. "requiredZipcode: $requiredZipcode\n"
. "requiredFundsAmount: $requiredFundsAmount\n"
. "additionalComments: $additionalComments\n"
. "success: $success\n"
. "\n"
. "\n"
. "\n"
. "\n"
. "To whom it may concern,\n"
. "\n"
. "This letter is to confirm a positive working relationship between Funding and  $requiredName.  Within funding guidelines, Funding LLC will provide $requiredName with the amount of funds up to $ $requiredFundsAmount , (private money), to purchase real estate located at $requiredAddress, $requiredCity, $requiredState $requiredZipcode.\n"

@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

//Sending auto respond Email to visitor
$pfw_header = "From: Info@info\n"
  . "Reply-To: Info@info.com\n";
$pfw_subject = "Thank you";
$pfw_email_to = "$requiredEmail";
$pfw_message =
"\n"
."To whom it may concern,\n"
. "\n"
"This letter is to confirm a positive working relationship between Funding and  $requiredName.  Within funding guidelines, Funding LLC will provide $requiredName with the amount of funds up to $ $requiredFundsAmount , (private money), to purchase real estate located at $requiredAddress, $requiredCity, $requiredState $requiredZipcode.\n"
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

header("Location: thankyou.html");

?>

Link to comment
Share on other sites

  • 2 weeks later...

I would google for a better mail class that allows you to send both HTML and text emails.

 

Short term you can try adding this to the header variable:

 

"Content-Type: text/html; charset=iso-8859-1\n";

 

You'll want to fully format the mail message to include proper HTML formatting to reduce the chances of getting flagged as spam.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.