I just spent several hours trying to figure out how to send an SMTP email with attachment from GoDaddy using PHPMailer. You can only do it via GoDaddy’s email relay. Here is the code for those looking. It is just the processor part and not the HTML form:
// Get File info uploaded $filename=$_FILES["upload"]["name"]; $filetype=$_FILES["upload"]["type"]; $filesize=$_FILES["upload"]["size"]; $filetemp=$_FILES["upload"]["tmp_name"]; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPDebug = 0; $mail->Host = "relay-hosting.secureserver.net"; $mail->Port = 25; $mail->Subject = "Subject Matter"; $body = "Baody of Facts"; $mail->AddAttachment($filetemp,$filename); $mail->MsgHTML($body); $mail->AddAddress('sendto@smtp.com', 'SendTo Email'); if(!$mail->Send()) { header("Location: failed.html"); } else { header("Location: success.html"); }
This is working as of the date of this post.