Hola amigos estoy haciendo un formulario de contacto pero necesito conectar este javascript a el sendmail.php pero no tengo ni idea que debe contener el php
si alguien me ayudara estaria muy agradecido
Este es el javaScript
Código PHP:
a.click(function () {
var a = h.val(),
b =
n.val(),
c = p.val(),
d = !1;
if (0 < a.length && 0 < b.length && 0 < c.length) d = !0;
else {
var e = 0;
!(0 < a.length) && "true" !== l.data("isErrorSet") && (t(l, 400 * e), e++);
!(0 < b.length) && "true" !== k.data("isErrorSet") && (t(k, 400 * e), e++);
!(0 < c.length) && "true" !== m.data("isErrorSet") && (t(m, 400 * e), e++)
}!0 === d && s(function () {
var d = JSON.stringify({
name: a,
from: b,
content: c
}),
e = !1;
$.get("sendmail.php", {
data: d
}).success(function () {
e = !0;
$(".page4 .letterSending").fadeOut(function () {
$(".page4 .letterSent").fadeIn()
})
}).error(function () {
e = !0;
$(".page4 .letterSending").fadeOut(function () {
$(".page4 .letterError").fadeIn()
})
});