Quantcast
Channel: Forums | InterWorx CP
Viewing all articles
Browse latest Browse all 900

Need help with sending mails with PHP

$
0
0
I don't know how to send mail with PHP from my website.

I've tried many codes that I found on different websites, but they dont work.
I've used the simplest ones like:

<?php
$message = "Line 1\r\nLine 2\r\nLine 3";
$message = wordwrap($message, 70, "\r\n");
mail('caffeinated@example.com', 'My Subject', $message);
?>

(this one doesnt make sense because i am not specifying which e-mail i am using)

Also I've tried codes similiar to this one:

<?php

$to = 'mailimsendingto@sdfs.com';
$subject = 'Test email';
$message = "Hello World!\n\nThis is my first mail.";
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
$mail_sent = @mail( $to, $subject, $message, $headers, 'f- postmaster@cenecigareta.rs' );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>


It would mean so much if someone helped me, thanks!

Viewing all articles
Browse latest Browse all 900

Trending Articles